Class: Rafflesia::OrganizationListResponse
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Rafflesia::OrganizationListResponse
- Defined in:
- lib/rafflesia/auth/organization_list_response.rb
Constant Summary collapse
- HASH_ATTRS =
{ active_organization_id: :active_organization_id, organizations: :organizations }.freeze
Instance Attribute Summary collapse
-
#active_organization_id ⇒ Object
Returns the value of attribute active_organization_id.
-
#organizations ⇒ Object
Returns the value of attribute organizations.
Instance Method Summary collapse
-
#initialize(json) ⇒ OrganizationListResponse
constructor
A new instance of OrganizationListResponse.
Constructor Details
#initialize(json) ⇒ OrganizationListResponse
Returns a new instance of OrganizationListResponse.
17 18 19 20 21 22 |
# File 'lib/rafflesia/auth/organization_list_response.rb', line 17 def initialize(json) super() hash = self.class.normalize(json) @active_organization_id = hash[:active_organization_id] @organizations = (hash[:organizations] || []).map { |item| item ? Rafflesia::OrganizationSummary.new(item) : nil } end |
Instance Attribute Details
#active_organization_id ⇒ Object
Returns the value of attribute active_organization_id.
13 14 15 |
# File 'lib/rafflesia/auth/organization_list_response.rb', line 13 def active_organization_id @active_organization_id end |
#organizations ⇒ Object
Returns the value of attribute organizations.
13 14 15 |
# File 'lib/rafflesia/auth/organization_list_response.rb', line 13 def organizations @organizations end |