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.



57012
57013
57014
57015
57016
57017
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57012

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.



57010
57011
57012
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57010

def description
  @description
end

#qObject (readonly)

Returns the value of attribute q.



57010
57011
57012
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57010

def q
  @q
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



57023
57024
57025
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57023

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

#to_hashObject



57027
57028
57029
57030
57031
57032
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57027

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

#to_jsonObject



57019
57020
57021
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57019

def to_json
  JSON.dump(to_hash)
end