Class: Slappy::Configuration
- Inherits:
-
Object
- Object
- Slappy::Configuration
- Defined in:
- lib/slappy/configuration.rb,
lib/slappy/configuration/robot.rb
Defined Under Namespace
Classes: Robot
Instance Attribute Summary collapse
-
#lib_dir_path ⇒ Object
Returns the value of attribute lib_dir_path.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#robot ⇒ Object
Returns the value of attribute robot.
-
#scripts_dir_path ⇒ Object
Returns the value of attribute scripts_dir_path.
-
#stop_with_error ⇒ Object
Returns the value of attribute stop_with_error.
-
#token ⇒ Object
Returns the value of attribute token.
Instance Method Summary collapse
- #config_file_path ⇒ Object
- #dsl ⇒ Object
- #dsl=(symbol) ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #send_params ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
5 6 7 |
# File 'lib/slappy/configuration.rb', line 5 def initialize @robot = Robot.new end |
Instance Attribute Details
#lib_dir_path ⇒ Object
Returns the value of attribute lib_dir_path.
3 4 5 |
# File 'lib/slappy/configuration.rb', line 3 def lib_dir_path @lib_dir_path end |
#logger ⇒ Object
Returns the value of attribute logger.
3 4 5 |
# File 'lib/slappy/configuration.rb', line 3 def logger @logger end |
#robot ⇒ Object
Returns the value of attribute robot.
3 4 5 |
# File 'lib/slappy/configuration.rb', line 3 def robot @robot end |
#scripts_dir_path ⇒ Object
Returns the value of attribute scripts_dir_path.
3 4 5 |
# File 'lib/slappy/configuration.rb', line 3 def scripts_dir_path @scripts_dir_path end |
#stop_with_error ⇒ Object
Returns the value of attribute stop_with_error.
3 4 5 |
# File 'lib/slappy/configuration.rb', line 3 def stop_with_error @stop_with_error end |
#token ⇒ Object
Returns the value of attribute token.
3 4 5 |
# File 'lib/slappy/configuration.rb', line 3 def token @token end |
Instance Method Details
#config_file_path ⇒ Object
26 27 28 |
# File 'lib/slappy/configuration.rb', line 26 def config_file_path './slappy_config.rb' end |
#dsl ⇒ Object
38 39 40 |
# File 'lib/slappy/configuration.rb', line 38 def dsl @dsl ||= :enabled end |
#dsl=(symbol) ⇒ Object
42 43 44 45 |
# File 'lib/slappy/configuration.rb', line 42 def dsl=(symbol) fail ArgumentError unless [:enabled, :disabled].include? symbol @dsl = symbol end |
#send_params ⇒ Object
47 48 49 50 51 52 53 54 55 |
# File 'lib/slappy/configuration.rb', line 47 def send_params { username: robot.username, icon_emoji: robot.icon_emoji, channel: robot.channel, icon_url: robot.icon_url, as_user: robot.as_user } end |