Class: Io::Flow::V0::Models::Shop

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 = {}) ⇒ 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

#idObject (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

#nameObject (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_hashObject



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_jsonObject



67059
67060
67061
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67059

def to_json
  JSON.dump(to_hash)
end