Class: Io::Flow::V0::Models::RatecardServiceSummary

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

Returns a new instance of RatecardServiceSummary.



57912
57913
57914
57915
57916
57917
57918
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57912

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:id, :name, :carrier], 'RatecardServiceSummary')
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
  @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
  @carrier = (x = opts.delete(:carrier); x.is_a?(::Io::Flow::V0::Models::RatecardCarrierSummary) ? x : ::Io::Flow::V0::Models::RatecardCarrierSummary.new(x))
end

Instance Attribute Details

#carrierObject (readonly)

Returns the value of attribute carrier.



57910
57911
57912
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57910

def carrier
  @carrier
end

#idObject (readonly)

Returns the value of attribute id.



57910
57911
57912
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57910

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



57910
57911
57912
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57910

def name
  @name
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



57924
57925
57926
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57924

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

#to_hashObject



57928
57929
57930
57931
57932
57933
57934
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57928

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

#to_jsonObject



57920
57921
57922
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57920

def to_json
  JSON.dump(to_hash)
end