class Io::Flow::V0::Models::RatecardRate

Specific line item in a ratecard lane with information on a weight threshold and corresponding amount to charge

Attributes

amount[R]
id[R]
weight[R]

Public Class Methods

new(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 62463
def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:id, :amount, :weight], 'RatecardRate')
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
  @amount = HttpClient::Preconditions.assert_class('amount', opts.delete(:amount), Numeric)
  @weight = HttpClient::Preconditions.assert_class('weight', opts.delete(:weight), Numeric)
end

Public Instance Methods

copy(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 62475
def copy(incoming={})
  RatecardRate.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end
to_hash() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 62479
def to_hash
  {
    :id => id,
    :amount => amount,
    :weight => weight
  }
end
to_json() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 62471
def to_json
  JSON.dump(to_hash)
end