Class: Earch
- Inherits:
-
Twing::Modules::Base
- Object
- Twing::Modules::Base
- Earch
- Defined in:
- lib/twing_earch/earch.rb,
lib/twing_earch/rules.rb
Defined Under Namespace
Instance Attribute Summary collapse
-
#notify ⇒ Object
readonly
Returns the value of attribute notify.
-
#rules ⇒ Object
readonly
Returns the value of attribute rules.
Instance Method Summary collapse
-
#initialize(*args) ⇒ Earch
constructor
A new instance of Earch.
- #on_message(object) ⇒ Object
Constructor Details
#initialize(*args) ⇒ Earch
Returns a new instance of Earch.
9 10 11 12 13 |
# File 'lib/twing_earch/earch.rb', line 9 def initialize(*args) super @notify = Notify.new(setting.slack) @rules = Rules.new(setting.rules || {}) end |
Instance Attribute Details
#notify ⇒ Object (readonly)
Returns the value of attribute notify.
7 8 9 |
# File 'lib/twing_earch/earch.rb', line 7 def notify @notify end |
#rules ⇒ Object (readonly)
Returns the value of attribute rules.
7 8 9 |
# File 'lib/twing_earch/earch.rb', line 7 def rules @rules end |
Instance Method Details
#on_message(object) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/twing_earch/earch.rb', line 15 def (object) case object when Twitter::Tweet logger.debug("Tweet #{object.id}") execute(object) end end |