Class: Io::Flow::V0::Models::TierReference

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 = {}) ⇒ TierReference

Returns a new instance of TierReference.



25114
25115
25116
25117
25118
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25114

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

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



25112
25113
25114
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25112

def id
  @id
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



25124
25125
25126
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25124

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

#to_hashObject



25128
25129
25130
25131
25132
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25128

def to_hash
  {
    :id => id
  }
end

#to_jsonObject



25120
25121
25122
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25120

def to_json
  JSON.dump(to_hash)
end