Module: EpsRapid

Defined in:
lib/eps-rapid.rb,
lib/eps-rapid/client.rb,
lib/eps-rapid/booking.rb,
lib/eps-rapid/content.rb,
lib/eps-rapid/version.rb,
lib/eps-rapid/shopping.rb,
lib/eps-rapid/geography.rb,
lib/eps-rapid/notifications.rb,
lib/eps-rapid/manage_booking.rb,
lib/eps-rapid/recommendations.rb,
lib/eps-rapid/errors/exceptions.rb,
lib/eps-rapid/errors/http_status_codes.rb

Defined Under Namespace

Modules: Exceptions, HttpStatusCodes Classes: Booking, Client, Content, Geography, ManageBooking, Notifications, Recommendations, Shopping

Constant Summary collapse

VERSION =
'1.3.0'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.api_keyObject

Returns the value of attribute api_key.



19
20
21
# File 'lib/eps-rapid.rb', line 19

def api_key
  @api_key
end

.base_pathObject

Returns the value of attribute base_path.



19
20
21
# File 'lib/eps-rapid.rb', line 19

def base_path
  @base_path
end

.language_resolverObject

Returns the value of attribute language_resolver.



19
20
21
# File 'lib/eps-rapid.rb', line 19

def language_resolver
  @language_resolver
end

.loggerObject

Returns the value of attribute logger.



19
20
21
# File 'lib/eps-rapid.rb', line 19

def logger
  @logger
end

.secret_keyObject

Returns the value of attribute secret_key.



19
20
21
# File 'lib/eps-rapid.rb', line 19

def secret_key
  @secret_key
end

Class Method Details

.auth_headerObject



25
26
27
28
29
30
# File 'lib/eps-rapid.rb', line 25

def auth_header
  timestamp    = Time.now.to_i
  to_be_hashed = "#{api_key}#{secret_key}#{timestamp}"
  signature    = Digest::SHA2.new(512).hexdigest(to_be_hashed)
  "EAN apikey=#{api_key},signature=#{signature},timestamp=#{timestamp}"
end

.configure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:

  • _self (EpsRapid)

    the object that the method was called on



21
22
23
# File 'lib/eps-rapid.rb', line 21

def configure
  yield(self)
end