Module: Slimpay

Defined in:
lib/slimpay.rb,
lib/slimpay/error.rb

Defined Under Namespace

Classes: Error

Constant Summary collapse

'https://api.slimpay.net/alps#'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.client_idObject

Returns the value of attribute client_id.



13
14
15
# File 'lib/slimpay.rb', line 13

def client_id
  @client_id
end

.client_secretObject

Returns the value of attribute client_secret.



13
14
15
# File 'lib/slimpay.rb', line 13

def client_secret
  @client_secret
end

.creditor_referenceObject

Returns the value of attribute creditor_reference.



13
14
15
# File 'lib/slimpay.rb', line 13

def creditor_reference
  @creditor_reference
end

.loggerObject

Returns the value of attribute logger.



13
14
15
# File 'lib/slimpay.rb', line 13

def logger
  @logger
end

Class Method Details

.baseObject



32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/slimpay.rb', line 32

def base
  return @base if @base

  if !self.client_id || !self.client_secret
    raise "[Slimpay] client_id or client_secret not defined"
  end

  json = request(:get, '/')
  klass = generate_resource(json)

  @base = Slimpay.const_set('Base', klass).new(json)
  @base
end

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

Yields:

  • (_self)

Yield Parameters:

  • _self (Slimpay)

    the object that the method was called on



19
20
21
# File 'lib/slimpay.rb', line 19

def configure
  yield(self)
end

.initializeObject



15
16
17
# File 'lib/slimpay.rb', line 15

def initialize
  sandbox = true
end

.sandboxObject



23
24
25
# File 'lib/slimpay.rb', line 23

def sandbox
  @sandbox != false
end

.sandbox=(value) ⇒ Object



27
28
29
30
# File 'lib/slimpay.rb', line 27

def sandbox=(value)
  @sandbox = value
  update_base_url
end