Class: Io::Flow::V0::Models::Shop
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::Shop
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ Shop
constructor
A new instance of Shop.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ Shop
Returns a new instance of Shop.
67052 67053 67054 67055 67056 67057 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67052 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:name, :id], 'Shop') @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String) @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String) end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
67050 67051 67052 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67050 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
67050 67051 67052 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67050 def name @name end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
67063 67064 67065 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67063 def copy(incoming={}) Shop.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
67067 67068 67069 67070 67071 67072 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67067 def to_hash { :name => name, :id => id } end |
#to_json ⇒ Object
67059 67060 67061 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67059 def to_json JSON.dump(to_hash) end |