Class: Payture::Cheques::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/payture/cheques/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**options) ⇒ Config

Returns a new instance of Config.



15
16
17
18
19
20
21
22
23
24
# File 'lib/payture/cheques/config.rb', line 15

def initialize(**options)
  @host = options[:host]
  @merchant_id = options[:merchant_id]
  @password = options[:password]
  @logger = options[:logger]
  @timeout = options[:timeout]
  @open_timeout = options[:open_timeout]

  check_required_fields!
end

Instance Attribute Details

#hostObject (readonly)

required



6
7
8
# File 'lib/payture/cheques/config.rb', line 6

def host
  @host
end

#loggerObject (readonly)

optional



11
12
13
# File 'lib/payture/cheques/config.rb', line 11

def logger
  @logger
end

#merchant_idObject (readonly)

Returns the value of attribute merchant_id.



7
8
9
# File 'lib/payture/cheques/config.rb', line 7

def merchant_id
  @merchant_id
end

#open_timeoutObject (readonly)

Returns the value of attribute open_timeout.



13
14
15
# File 'lib/payture/cheques/config.rb', line 13

def open_timeout
  @open_timeout
end

#passwordObject (readonly)

Returns the value of attribute password.



8
9
10
# File 'lib/payture/cheques/config.rb', line 8

def password
  @password
end

#timeoutObject (readonly)

Returns the value of attribute timeout.



12
13
14
# File 'lib/payture/cheques/config.rb', line 12

def timeout
  @timeout
end

Instance Method Details

#base_urlObject



26
27
28
# File 'lib/payture/cheques/config.rb', line 26

def base_url
  "https://#{host}/apicheque"
end