Class: Io::Flow::V0::Models::Subcatalog
- Inherits:
-
ExpandableSubcatalog
- Object
- ExpandableSubcatalog
- Io::Flow::V0::Models::Subcatalog
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
A configuration with custom query to select a subset of master catalog items for a localized experience
Instance Attribute Summary collapse
-
#catalog ⇒ Object
readonly
Returns the value of attribute catalog.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#settings ⇒ Object
readonly
Returns the value of attribute settings.
Attributes inherited from ExpandableSubcatalog
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ Subcatalog
constructor
A new instance of Subcatalog.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from ExpandableSubcatalog
Constructor Details
#initialize(incoming = {}) ⇒ Subcatalog
Returns a new instance of Subcatalog.
26854 26855 26856 26857 26858 26859 26860 26861 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26854 def initialize(incoming={}) super(:discriminator => ExpandableSubcatalog::Types::SUBCATALOG) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:id, :catalog, :settings], 'Subcatalog') @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String) @catalog = (x = opts.delete(:catalog); x.is_a?(::Io::Flow::V0::Models::Catalog) ? x : ::Io::Flow::V0::Models::Catalog.new(x)) @settings = (x = opts.delete(:settings); x.is_a?(::Io::Flow::V0::Models::SubcatalogSettings) ? x : ::Io::Flow::V0::Models::SubcatalogSettings.new(x)) end |
Instance Attribute Details
#catalog ⇒ Object (readonly)
Returns the value of attribute catalog.
26852 26853 26854 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26852 def catalog @catalog end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
26852 26853 26854 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26852 def id @id end |
#settings ⇒ Object (readonly)
Returns the value of attribute settings.
26852 26853 26854 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26852 def settings @settings end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
26867 26868 26869 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26867 def copy(incoming={}) Subcatalog.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
26871 26872 26873 26874 26875 26876 26877 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26871 def subtype_to_hash { :id => id, :catalog => catalog.to_hash, :settings => settings.to_hash } end |
#to_json ⇒ Object
26863 26864 26865 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26863 def to_json JSON.dump(to_hash) end |