Class: ChatworkBridge::Settings

Inherits:
Object
  • Object
show all
Defined in:
lib/chatwork_bridge/settings.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSettings

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_emailObject

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_urlObject

Returns the value of attribute chatwork_login_url.



6
7
8
# File 'lib/chatwork_bridge/settings.rb', line 6

def 
  @chatwork_login_url
end

#chatwork_passwordObject

Returns the value of attribute chatwork_password.



6
7
8
# File 'lib/chatwork_bridge/settings.rb', line 6

def chatwork_password
  @chatwork_password
end

#notifiersObject (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