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.



55400
55401
55402
55403
55404
55405
55406
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55400

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.



55398
55399
55400
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55398

def carrier
  @carrier
end

#idObject (readonly)

Returns the value of attribute id.



55398
55399
55400
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55398

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



55398
55399
55400
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55398

def name
  @name
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



55412
55413
55414
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55412

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

#to_hashObject



55416
55417
55418
55419
55420
55421
55422
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55416

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

#to_jsonObject



55408
55409
55410
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55408

def to_json
  JSON.dump(to_hash)
end