Class: Io::Flow::V0::Models::HarmonizedCategoryReference

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ HarmonizedCategoryReference

Returns a new instance of HarmonizedCategoryReference.



29886
29887
29888
29889
29890
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29886

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:id], 'HarmonizedCategoryReference')
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



29884
29885
29886
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29884

def id
  @id
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



29896
29897
29898
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29896

def copy(incoming={})
  HarmonizedCategoryReference.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#to_hashObject



29900
29901
29902
29903
29904
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29900

def to_hash
  {
    :id => id
  }
end

#to_jsonObject



29892
29893
29894
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29892

def to_json
  JSON.dump(to_hash)
end