Class: Io::Flow::V0::Models::TierDisplay

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

Returns a new instance of TierDisplay.



41945
41946
41947
41948
41949
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41945

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:estimate], 'TierDisplay')
  @estimate = (x = opts.delete(:estimate); x.is_a?(::Io::Flow::V0::Models::TierEstimate) ? x : ::Io::Flow::V0::Models::TierEstimate.new(x))
end

Instance Attribute Details

#estimateObject (readonly)

Returns the value of attribute estimate.



41943
41944
41945
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41943

def estimate
  @estimate
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



41955
41956
41957
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41955

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

#to_hashObject



41959
41960
41961
41962
41963
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41959

def to_hash
  {
    :estimate => estimate.to_hash
  }
end

#to_jsonObject



41951
41952
41953
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41951

def to_json
  JSON.dump(to_hash)
end