Class: ChatworkBridge::Settings
- Inherits:
-
Object
- Object
- ChatworkBridge::Settings
- Defined in:
- lib/chatwork_bridge/settings.rb
Instance Attribute Summary collapse
-
#chatwork_email ⇒ Object
Returns the value of attribute chatwork_email.
-
#chatwork_login_url ⇒ Object
Returns the value of attribute chatwork_login_url.
-
#chatwork_password ⇒ Object
Returns the value of attribute chatwork_password.
-
#notifiers ⇒ Object
readonly
Returns the value of attribute notifiers.
Instance Method Summary collapse
-
#initialize ⇒ Settings
constructor
A new instance of Settings.
- #log_device=(device) ⇒ Object
- #log_level=(level) ⇒ Object
- #notifier(type, &block) ⇒ Object
Constructor Details
#initialize ⇒ Settings
Returns a new instance of Settings.
8 9 10 |
# File 'lib/chatwork_bridge/settings.rb', line 8 def initialize @notifiers = [] end |
Instance Attribute Details
#chatwork_email ⇒ Object
Returns the value of attribute chatwork_email.
6 7 8 |
# File 'lib/chatwork_bridge/settings.rb', line 6 def chatwork_email @chatwork_email end |
#chatwork_login_url ⇒ Object
Returns the value of attribute chatwork_login_url.
6 7 8 |
# File 'lib/chatwork_bridge/settings.rb', line 6 def chatwork_login_url @chatwork_login_url end |
#chatwork_password ⇒ Object
Returns the value of attribute chatwork_password.
6 7 8 |
# File 'lib/chatwork_bridge/settings.rb', line 6 def chatwork_password @chatwork_password end |
#notifiers ⇒ Object (readonly)
Returns the value of attribute notifiers.
5 6 7 |
# File 'lib/chatwork_bridge/settings.rb', line 5 def notifiers @notifiers end |
Instance Method Details
#log_device=(device) ⇒ Object
19 20 21 |
# File 'lib/chatwork_bridge/settings.rb', line 19 def log_device=(device) $logger = Logger.new(device) end |
#log_level=(level) ⇒ Object
23 24 25 |
# File 'lib/chatwork_bridge/settings.rb', line 23 def log_level=(level) $logger.level = level end |
#notifier(type, &block) ⇒ Object
12 13 14 15 16 17 |
# File 'lib/chatwork_bridge/settings.rb', line 12 def notifier(type, &block) clazz = Notifiers.const_get("#{type.to_s.capitalize}Notifier") notifier = clazz.new notifier.instance_eval(&block) @notifiers << notifier end |