Class: Io::Flow::V0::Models::TierEstimate

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

Returns a new instance of TierEstimate.



41984
41985
41986
41987
41988
41989
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41984

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:type], 'TierEstimate')
  @type = (x = opts.delete(:type); x.is_a?(::Io::Flow::V0::Models::TierEstimateType) ? x : ::Io::Flow::V0::Models::TierEstimateType.apply(x))
  @label = (x = opts.delete(:label); x.nil? ? nil : HttpClient::Preconditions.assert_class('label', x, String))
end

Instance Attribute Details

#labelObject (readonly)

Returns the value of attribute label.



41982
41983
41984
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41982

def label
  @label
end

#typeObject (readonly)

Returns the value of attribute type.



41982
41983
41984
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41982

def type
  @type
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



41995
41996
41997
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41995

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

#to_hashObject



41999
42000
42001
42002
42003
42004
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41999

def to_hash
  {
    :type => type.value,
    :label => label
  }
end

#to_jsonObject



41991
41992
41993
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41991

def to_json
  JSON.dump(to_hash)
end