Class: Noah::CustomWatcher
- Inherits:
-
Object
- Object
- Noah::CustomWatcher
- Extended by:
- Passthrough
- Defined in:
- lib/noah/custom_watcher.rb
Instance Attribute Summary collapse
-
#my_destination ⇒ Object
Returns the value of attribute my_destination.
-
#my_pattern ⇒ Object
Returns the value of attribute my_pattern.
-
#my_redis ⇒ Object
Returns the value of attribute my_redis.
Class Method Summary collapse
- .destination(destination) ⇒ Object
- .pattern(pattern) ⇒ Object
- .redis_host(host) ⇒ Object
- .run! ⇒ Object
- .watch(&blk) ⇒ Object
Instance Method Summary collapse
-
#initialize ⇒ CustomWatcher
constructor
A new instance of CustomWatcher.
Methods included from Passthrough
Constructor Details
#initialize ⇒ CustomWatcher
Returns a new instance of CustomWatcher.
30 31 32 33 |
# File 'lib/noah/custom_watcher.rb', line 30 def initialize @my_redis ||= ENV['REDIS_URL'] @my_pattern ||= '//noah' end |
Instance Attribute Details
#my_destination ⇒ Object
Returns the value of attribute my_destination.
22 23 24 |
# File 'lib/noah/custom_watcher.rb', line 22 def my_destination @my_destination end |
#my_pattern ⇒ Object
Returns the value of attribute my_pattern.
22 23 24 |
# File 'lib/noah/custom_watcher.rb', line 22 def my_pattern @my_pattern end |
#my_redis ⇒ Object
Returns the value of attribute my_redis.
22 23 24 |
# File 'lib/noah/custom_watcher.rb', line 22 def my_redis @my_redis end |
Class Method Details
.destination(destination) ⇒ Object
43 44 45 |
# File 'lib/noah/custom_watcher.rb', line 43 def self.destination(destination) @my_destination = destination end |
.pattern(pattern) ⇒ Object
39 40 41 |
# File 'lib/noah/custom_watcher.rb', line 39 def self.pattern(pattern) @my_pattern = pattern end |
.redis_host(host) ⇒ Object
35 36 37 |
# File 'lib/noah/custom_watcher.rb', line 35 def self.redis_host(host) @my_redis = host end |
.run! ⇒ Object
47 48 49 |
# File 'lib/noah/custom_watcher.rb', line 47 def self.run! @my_destination.nil? ? (raise ArgumentError) : run_watcher(@my_destination) end |