Class: Io::Flow::V0::Models::ExpandableOrganization
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::ExpandableOrganization
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Direct Known Subclasses
ExpandableOrganizationUndefinedType, Organization, OrganizationReference
Defined Under Namespace
Modules: Types
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(incoming = {}) ⇒ ExpandableOrganization
constructor
A new instance of ExpandableOrganization.
- #to_hash ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ ExpandableOrganization
Returns a new instance of ExpandableOrganization.
4139 4140 4141 4142 4143 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4139 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:name], 'ExpandableOrganization') @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String) end |
Class Method Details
.from_json(hash) ⇒ Object
4149 4150 4151 4152 4153 4154 4155 4156 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4149 def ExpandableOrganization.from_json(hash) HttpClient::Preconditions.assert_class('hash', hash, Hash) case HttpClient::Helper.symbolize_keys(hash)[:discriminator] when Types::ORGANIZATION; Organization.new(hash) when Types::ORGANIZATION_REFERENCE; OrganizationReference.new(hash) else ExpandableOrganizationUndefinedType.new(:name => union_type_name) end end |
Instance Method Details
#to_hash ⇒ Object
4145 4146 4147 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4145 def to_hash subtype_to_hash.merge(:discriminator => @name) end |