Class: Io::Flow::V0::Models::InputForm

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

Returns a new instance of InputForm.



26891
26892
26893
26894
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26891

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  @values = (x = opts.delete(:values); x.nil? ? nil : HttpClient::Preconditions.assert_class('values', x, Hash).inject({}) { |h, d| h[d[0]] = HttpClient::Preconditions.assert_class('values', d[1], String); h })
end

Instance Attribute Details

#valuesObject (readonly)

Returns the value of attribute values.



26889
26890
26891
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26889

def values
  @values
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



26900
26901
26902
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26900

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

#to_hashObject



26904
26905
26906
26907
26908
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26904

def to_hash
  {
    :values => values.nil? ? nil : values
  }
end

#to_jsonObject



26896
26897
26898
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26896

def to_json
  JSON.dump(to_hash)
end