Class: Viberroo::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/viberroo/configuration.rb

Overview

Stores runtime configuration information.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.


52
53
54
55
56
57
58
59
60
61
# File 'lib/viberroo/configuration.rb', line 52

def initialize
  @auth_token = nil

  @logger = Logger.new(STDOUT)
  @logger.formatter = proc do |severity, datetime, _, msg|
    "[#{datetime}] #{severity} Viberroo::Bot #{msg}\n"
  end

  @parse_response_body = true
end

Instance Attribute Details

#auth_tokenString

Stores Viber API authentication token. Necessary for the bot to send API requests.

Returns:

  • (String)

See Also:


42
43
44
# File 'lib/viberroo/configuration.rb', line 42

def auth_token
  @auth_token
end

#loggerLogger

Specifies logger.

Returns:

  • (Logger)

33
34
35
# File 'lib/viberroo/configuration.rb', line 33

def logger
  @logger
end

#parse_response_bodytrue || false

Specifies whether to parse response body of Bot requests.

Returns:

  • (true || false)

See Also:


50
51
52
# File 'lib/viberroo/configuration.rb', line 50

def parse_response_body
  @parse_response_body
end