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