Class: Io::Flow::V0::Models::ReturnReason
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::ReturnReason
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ ReturnReason
constructor
A new instance of ReturnReason.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ ReturnReason
Returns a new instance of ReturnReason.
22383 22384 22385 22386 22387 22388 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22383 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:key, :name], 'ReturnReason') @key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String) @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String) end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
22381 22382 22383 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22381 def key @key end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
22381 22382 22383 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22381 def name @name end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
22394 22395 22396 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22394 def copy(incoming={}) ReturnReason.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
22398 22399 22400 22401 22402 22403 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22398 def to_hash { :key => key, :name => name } end |
#to_json ⇒ Object
22390 22391 22392 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22390 def to_json JSON.dump(to_hash) end |