Class: Io::Flow::V0::Models::ReturnPolicyForm

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

Returns a new instance of ReturnPolicyForm.



64215
64216
64217
64218
64219
64220
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 64215

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:q], 'ReturnPolicyForm')
  @q = HttpClient::Preconditions.assert_class('q', opts.delete(:q), String)
  @description = (x = opts.delete(:description); x.nil? ? nil : HttpClient::Preconditions.assert_class('description', x, String))
end

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description.



64213
64214
64215
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 64213

def description
  @description
end

#qObject (readonly)

Returns the value of attribute q.



64213
64214
64215
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 64213

def q
  @q
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



64226
64227
64228
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 64226

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

#to_hashObject



64230
64231
64232
64233
64234
64235
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 64230

def to_hash
  {
    :q => q,
    :description => description
  }
end

#to_jsonObject



64222
64223
64224
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 64222

def to_json
  JSON.dump(to_hash)
end