Class: Io::Flow::V0::Models::PriceCheck

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

Returns a new instance of PriceCheck.



41925
41926
41927
41928
41929
41930
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41925

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

Instance Attribute Details

#displayObject (readonly)

Returns the value of attribute display.



41923
41924
41925
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41923

def display
  @display
end

#finalObject (readonly)

Returns the value of attribute final.



41923
41924
41925
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41923

def final
  @final
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



41936
41937
41938
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41936

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

#to_hashObject



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

def to_hash
  {
    :display => display.to_hash,
    :final => final.to_hash
  }
end

#to_jsonObject



41932
41933
41934
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41932

def to_json
  JSON.dump(to_hash)
end