Class: Io::Flow::V0::Models::ExpandableSubcatalog
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::ExpandableSubcatalog
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
A subcatalog can be represented with just it’s ID, or the entire model
Direct Known Subclasses
ExpandableSubcatalogUndefinedType, Subcatalog, SubcatalogReference
Defined Under Namespace
Modules: Types
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(incoming = {}) ⇒ ExpandableSubcatalog
constructor
A new instance of ExpandableSubcatalog.
- #to_hash ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ ExpandableSubcatalog
Returns a new instance of ExpandableSubcatalog.
3966 3967 3968 3969 3970 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 3966 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:name], 'ExpandableSubcatalog') @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String) end |
Class Method Details
.from_json(hash) ⇒ Object
3976 3977 3978 3979 3980 3981 3982 3983 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 3976 def ExpandableSubcatalog.from_json(hash) HttpClient::Preconditions.assert_class('hash', hash, Hash) case HttpClient::Helper.symbolize_keys(hash)[:discriminator] when Types::SUBCATALOG; Subcatalog.new(hash) when Types::SUBCATALOG_REFERENCE; SubcatalogReference.new(hash) else ExpandableSubcatalogUndefinedType.new(:name => union_type_name) end end |
Instance Method Details
#to_hash ⇒ Object
3972 3973 3974 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 3972 def to_hash subtype_to_hash.merge(:discriminator => @name) end |