Class: Beslist::API::Connection

Inherits:
Object
  • Object
show all
Includes:
Requests
Defined in:
lib/beslist/connection.rb,
lib/beslist/connection/requests.rb

Defined Under Namespace

Modules: Requests

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Requests

#request

Constructor Details

#initialize(options = {}) ⇒ Connection

Returns a new instance of Connection.



14
15
16
# File 'lib/beslist/connection.rb', line 14

def initialize(options = {})
  @options = options
end

Instance Attribute Details

#interfaceObject

Returns the value of attribute interface.



12
13
14
# File 'lib/beslist/connection.rb', line 12

def interface
  @interface
end

#optionsObject

Returns the value of attribute options.



12
13
14
# File 'lib/beslist/connection.rb', line 12

def options
  @options
end

Instance Method Details

#checksum(*dynamic_parts) ⇒ Object



26
27
28
29
# File 'lib/beslist/connection.rb', line 26

def checksum(*dynamic_parts)
  base = options[:personal_key]+options[:client_id]+options[:shop_id]
  Digest::MD5.hexdigest(base+dynamic_parts.join(''))
end