Class: Io::Flow::V0::Models::RatecardSummary

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



45917
45918
45919
45920
45921
45922
45923
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45917

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:id, :number, :ratecard_owner], 'RatecardSummary')
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
  @number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String)
  @ratecard_owner = (x = opts.delete(:ratecard_owner); x.is_a?(::Io::Flow::V0::Models::RatecardOwner) ? x : ::Io::Flow::V0::Models::RatecardOwner.apply(x))
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



45915
45916
45917
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45915

def id
  @id
end

#numberObject (readonly)

Returns the value of attribute number.



45915
45916
45917
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45915

def number
  @number
end

#ratecard_ownerObject (readonly)

Returns the value of attribute ratecard_owner.



45915
45916
45917
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45915

def ratecard_owner
  @ratecard_owner
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



45929
45930
45931
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45929

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

#to_hashObject



45933
45934
45935
45936
45937
45938
45939
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45933

def to_hash
  {
    :id => id,
    :number => number,
    :ratecard_owner => ratecard_owner.value
  }
end

#to_jsonObject



45925
45926
45927
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45925

def to_json
  JSON.dump(to_hash)
end