| Total Complexity | 3 |
| Total Lines | 20 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | module Awspec::Type |
||
| 2 | class OrganizationsOrganization < ResourceBase |
||
| 3 | def resource_via_client |
||
| 4 | @resource_via_client ||= find_organization |
||
| 5 | end |
||
| 6 | |||
| 7 | def id |
||
| 8 | @id ||= resource_via_client.id if resource_via_client |
||
| 9 | end |
||
| 10 | |||
| 11 | STATUSES = %w( |
||
| 12 | ENABLED PENDING_ENABLE PENDING_DISABLE |
||
| 13 | ) |
||
| 14 | STATUSES.each do |status| |
||
| 15 | define_method "service_control_policy_#{status.downcase}?" do |
||
| 16 | return false if resource_via_client.available_policy_types.size != 1 |
||
| 17 | policy = resource_via_client.available_policy_types.first |
||
| 18 | policy.status == status |
||
| 19 | end |
||
| 20 | end |
||
| 21 | end |
||
| 22 | end |
||
| 23 |