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.



26281
26282
26283
26284
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26281

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.



26279
26280
26281
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26279

def values
  @values
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



26290
26291
26292
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26290

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

#to_hashObject



26294
26295
26296
26297
26298
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26294

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

#to_jsonObject



26286
26287
26288
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26286

def to_json
  JSON.dump(to_hash)
end