Class: Slappy::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/slappy/configuration.rb,
lib/slappy/configuration/robot.rb

Defined Under Namespace

Classes: Robot

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

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_pathObject

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

#loggerObject

Returns the value of attribute logger.



3
4
5
# File 'lib/slappy/configuration.rb', line 3

def logger
  @logger
end

#robotObject

Returns the value of attribute robot.



3
4
5
# File 'lib/slappy/configuration.rb', line 3

def robot
  @robot
end

#scripts_dir_pathObject

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_errorObject

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

#tokenObject

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_pathObject



26
27
28
# File 'lib/slappy/configuration.rb', line 26

def config_file_path
  './slappy_config.rb'
end

#dslObject



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_paramsObject



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