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.



44065
44066
44067
44068
44069
44070
44071
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44065

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.



44063
44064
44065
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44063

def carrier
  @carrier
end

#idObject (readonly)

Returns the value of attribute id.



44063
44064
44065
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44063

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



44063
44064
44065
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44063

def name
  @name
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



44077
44078
44079
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44077

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

#to_hashObject



44081
44082
44083
44084
44085
44086
44087
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44081

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

#to_jsonObject



44073
44074
44075
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44073

def to_json
  JSON.dump(to_hash)
end