Class: Io::Flow::V0::Models::HarmonizedCategory
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::HarmonizedCategory
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Categories optimized for harmonization
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ HarmonizedCategory
constructor
A new instance of HarmonizedCategory.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ HarmonizedCategory
16025 16026 16027 16028 16029 16030 16031 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16025 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:id, :name], 'HarmonizedCategory') @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String) @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String) @parent = (x = opts.delete(:parent); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::HarmonizedCategoryReference) ? x : ::Io::Flow::V0::Models::HarmonizedCategoryReference.new(x))) end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
16023 16024 16025 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16023 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
16023 16024 16025 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16023 def name @name end |
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
16023 16024 16025 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16023 def parent @parent end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
16037 16038 16039 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16037 def copy(incoming={}) HarmonizedCategory.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
16041 16042 16043 16044 16045 16046 16047 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16041 def to_hash { :id => id, :name => name, :parent => parent.nil? ? nil : parent.to_hash } end |
#to_json ⇒ Object
16033 16034 16035 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16033 def to_json JSON.dump(to_hash) end |