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.



46619
46620
46621
46622
46623
46624
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46619

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.



46617
46618
46619
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46617

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



46617
46618
46619
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46617

def name
  @name
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



46630
46631
46632
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46630

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

#to_hashObject



46634
46635
46636
46637
46638
46639
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46634

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

#to_jsonObject



46626
46627
46628
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46626

def to_json
  JSON.dump(to_hash)
end