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.



35225
35226
35227
35228
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35225

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.



35223
35224
35225
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35223

def values
  @values
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



35234
35235
35236
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35234

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

#to_hashObject



35238
35239
35240
35241
35242
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35238

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

#to_jsonObject



35230
35231
35232
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35230

def to_json
  JSON.dump(to_hash)
end