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.
3939 3940 3941 3942 3943 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 3939 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
3949 3950 3951 3952 3953 3954 3955 3956 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 3949 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
3945 3946 3947 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 3945 def to_hash subtype_to_hash.merge(:discriminator => @name) end |