Class: Io::Flow::V0::Models::HarmonizationDocument
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#categories ⇒ Object
readonly
Returns the value of attribute categories.
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#origin ⇒ Object
readonly
Returns the value of attribute origin.
Attributes inherited from Document
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ HarmonizationDocument
constructor
A new instance of HarmonizationDocument.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from Document
Constructor Details
#initialize(incoming = {}) ⇒ HarmonizationDocument
Returns a new instance of HarmonizationDocument.
15839 15840 15841 15842 15843 15844 15845 15846 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15839 def initialize(incoming={}) super(:discriminator => Document::Types::HARMONIZATION_DOCUMENT) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:code, :categories], 'HarmonizationDocument') @code = HttpClient::Preconditions.assert_class('code', opts.delete(:code), String) @categories = HttpClient::Preconditions.assert_class('categories', opts.delete(:categories), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::CategorySummary) ? x : ::Io::Flow::V0::Models::CategorySummary.new(x)) } @origin = (x = opts.delete(:origin); x.nil? ? nil : HttpClient::Preconditions.assert_class('origin', x, String)) end |
Instance Attribute Details
#categories ⇒ Object (readonly)
Returns the value of attribute categories.
15837 15838 15839 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15837 def categories @categories end |
#code ⇒ Object (readonly)
Returns the value of attribute code.
15837 15838 15839 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15837 def code @code end |
#origin ⇒ Object (readonly)
Returns the value of attribute origin.
15837 15838 15839 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15837 def origin @origin end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
15852 15853 15854 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15852 def copy(incoming={}) HarmonizationDocument.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
15856 15857 15858 15859 15860 15861 15862 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15856 def subtype_to_hash { :code => code, :categories => categories.map { |o| o.to_hash }, :origin => origin } end |
#to_json ⇒ Object
15848 15849 15850 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15848 def to_json JSON.dump(to_hash) end |