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.



49455
49456
49457
49458
49459
49460
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49455

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.



49453
49454
49455
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49453

def description
  @description
end

#qObject (readonly)

Returns the value of attribute q.



49453
49454
49455
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49453

def q
  @q
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



49466
49467
49468
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49466

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

#to_hashObject



49470
49471
49472
49473
49474
49475
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49470

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

#to_jsonObject



49462
49463
49464
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49462

def to_json
  JSON.dump(to_hash)
end