Completed
Pull Request — master (#367)
by
unknown
03:47
created

OrganizationsAccount   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 27
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A resource_via_client() 0 3 1
A id() 0 3 2
1
module Awspec::Type
2
  class OrganizationsAccount < ResourceBase
3
    def resource_via_client
4
      @resource_via_client ||= find_account(@display_name)
5
    end
6
7
    def id
8
      @id ||= resource_via_client.id if resource_via_client
9
    end
10
11
    STATUSES = %w(
12
      ACTIVE SUSPENDED
13
    )
14
    STATUSES.each do |status|
15
      define_method status.downcase + '?' do
16
        resource_via_client.status == status
17
      end
18
    end
19
20
    JOIN_METHODS = %w(
21
      INVITED CREATED
22
    )
23
    JOIN_METHODS.each do |joined_method|
24
      define_method joined_method.downcase + '?' do
25
        resource_via_client.joined_method == joined_method
26
      end
27
    end
28
  end
29
end
30