Class: Io::Flow::V0::Models::RatecardCarrierSummary

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

Returns a new instance of RatecardCarrierSummary.



45259
45260
45261
45262
45263
45264
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45259

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

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



45257
45258
45259
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45257

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



45257
45258
45259
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45257

def name
  @name
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



45270
45271
45272
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45270

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

#to_hashObject



45274
45275
45276
45277
45278
45279
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45274

def to_hash
  {
    :id => id,
    :name => name
  }
end

#to_jsonObject



45266
45267
45268
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45266

def to_json
  JSON.dump(to_hash)
end