Class: ActionSlack::Configuration

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



23
24
25
# File 'lib/action_slack/configuration.rb', line 23

def initialize
  @configuration = self.class.default_configuration.dup
end

Instance Attribute Details

#asyncObject

Returns the value of attribute async.



5
6
7
# File 'lib/action_slack/configuration.rb', line 5

def async
  @async
end

#filepathObject

Returns the value of attribute filepath.



5
6
7
# File 'lib/action_slack/configuration.rb', line 5

def filepath
  @filepath
end

Class Method Details

.default_configurationObject



19
20
21
# File 'lib/action_slack/configuration.rb', line 19

def self.default_configuration
  @default_configuration ||= {}
end

.set_default(name, default) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/action_slack/configuration.rb', line 7

def self.set_default(name, default)
  define_method name do
    @configuration[name]
  end

  define_method :"#{name}=" do |value|
    @configuration[name] = value
  end

  default_configuration[name] = default
end

Instance Method Details

#async?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/action_slack/configuration.rb', line 27

def async?
  async
end