Class: Io::Flow::V0::Models::ExpandableUser
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::ExpandableUser
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Direct Known Subclasses
Defined Under Namespace
Modules: Types
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(incoming = {}) ⇒ ExpandableUser
constructor
A new instance of ExpandableUser.
- #to_hash ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ ExpandableUser
Returns a new instance of ExpandableUser.
4244 4245 4246 4247 4248 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4244 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:name], 'ExpandableUser') @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String) end |
Class Method Details
.from_json(hash) ⇒ Object
4254 4255 4256 4257 4258 4259 4260 4261 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4254 def ExpandableUser.from_json(hash) HttpClient::Preconditions.assert_class('hash', hash, Hash) case HttpClient::Helper.symbolize_keys(hash)[:discriminator] when Types::USER; User.new(hash) when Types::USER_REFERENCE; UserReference.new(hash) else ExpandableUserUndefinedType.new(:name => union_type_name) end end |
Instance Method Details
#to_hash ⇒ Object
4250 4251 4252 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4250 def to_hash subtype_to_hash.merge(:discriminator => @name) end |