Class: Rafflesia::OrganizationListResponse

Inherits:
Types::BaseModel
  • Object
show all
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

Instance Method Summary collapse

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_idObject

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

#organizationsObject

Returns the value of attribute organizations.



13
14
15
# File 'lib/rafflesia/auth/organization_list_response.rb', line 13

def organizations
  @organizations
end