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

OrganizationsAccount.id()   A

Complexity

Conditions 2

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 2
c 1
b 0
f 1
dl 0
loc 3
rs 10
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