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.



59524
59525
59526
59527
59528
59529
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 59524

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.



59522
59523
59524
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 59522

def description
  @description
end

#qObject (readonly)

Returns the value of attribute q.



59522
59523
59524
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 59522

def q
  @q
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



59535
59536
59537
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 59535

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

#to_hashObject



59539
59540
59541
59542
59543
59544
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 59539

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

#to_jsonObject



59531
59532
59533
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 59531

def to_json
  JSON.dump(to_hash)
end