Class: TelegramOnSteroids::Configuration
- Inherits:
-
Object
- Object
- TelegramOnSteroids::Configuration
- Defined in:
- lib/telegram_on_steroids/configuration.rb
Constant Summary collapse
- REQUIRED_PARAMS =
%i(start_action api_token)
Instance Attribute Summary collapse
-
#api_token ⇒ Object
Returns the value of attribute api_token.
-
#client ⇒ Object
Returns the value of attribute client.
-
#commands ⇒ Object
Returns the value of attribute commands.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#session_store ⇒ Object
Returns the value of attribute session_store.
-
#start_action ⇒ Object
Returns the value of attribute start_action.
-
#webhook_params ⇒ Object
Returns the value of attribute webhook_params.
-
#webhook_url ⇒ Object
Returns the value of attribute webhook_url.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #verify! ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/telegram_on_steroids/configuration.rb', line 29 def initialize @client = TelegramOnSteroids::Client @webhook_params = {} if defined?(Rails) @session_store = Rails.cache @logger = Rails.logger else @session_store = InMemoryStore @logger = Logger.new(STDOUT) end end |
Instance Attribute Details
#api_token ⇒ Object
Returns the value of attribute api_token.
24 25 26 |
# File 'lib/telegram_on_steroids/configuration.rb', line 24 def api_token @api_token end |
#client ⇒ Object
Returns the value of attribute client.
24 25 26 |
# File 'lib/telegram_on_steroids/configuration.rb', line 24 def client @client end |
#commands ⇒ Object
Returns the value of attribute commands.
24 25 26 |
# File 'lib/telegram_on_steroids/configuration.rb', line 24 def commands @commands end |
#logger ⇒ Object
Returns the value of attribute logger.
24 25 26 |
# File 'lib/telegram_on_steroids/configuration.rb', line 24 def logger @logger end |
#session_store ⇒ Object
Returns the value of attribute session_store.
24 25 26 |
# File 'lib/telegram_on_steroids/configuration.rb', line 24 def session_store @session_store end |
#start_action ⇒ Object
Returns the value of attribute start_action.
24 25 26 |
# File 'lib/telegram_on_steroids/configuration.rb', line 24 def start_action @start_action end |
#webhook_params ⇒ Object
Returns the value of attribute webhook_params.
24 25 26 |
# File 'lib/telegram_on_steroids/configuration.rb', line 24 def webhook_params @webhook_params end |
#webhook_url ⇒ Object
Returns the value of attribute webhook_url.
24 25 26 |
# File 'lib/telegram_on_steroids/configuration.rb', line 24 def webhook_url @webhook_url end |
Instance Method Details
#verify! ⇒ Object
42 43 44 45 46 47 48 |
# File 'lib/telegram_on_steroids/configuration.rb', line 42 def verify! blank_params = REQUIRED_PARAMS.select { |p| send(p).nil? } if blank_params.any? raise StandardError, blank_params end end |