Class: Amberletters::Trigger
- Inherits:
-
Object
- Object
- Amberletters::Trigger
- Defined in:
- lib/amberletters.rb
Direct Known Subclasses
BytesTrigger, ExitTrigger, OutputTrigger, TimeoutTrigger, UnsatisfiedTrigger
Instance Attribute Summary collapse
-
#exclusive ⇒ Object
(also: #exclusive?)
Returns the value of attribute exclusive.
-
#interruption ⇒ Object
Returns the value of attribute interruption.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#time_to_live ⇒ Object
Returns the value of attribute time_to_live.
Instance Method Summary collapse
- #call(process) ⇒ Object
-
#initialize(options = {}, &block) ⇒ Trigger
constructor
A new instance of Trigger.
Constructor Details
#initialize(options = {}, &block) ⇒ Trigger
Returns a new instance of Trigger.
66 67 68 69 70 71 72 |
# File 'lib/amberletters.rb', line 66 def initialize(={}, &block) @block = block || lambda{|*|} @exclusive = .fetch(:exclusive) { false } @logger = ::Logger.new($stdout) @interruption = :none = end |
Instance Attribute Details
#exclusive ⇒ Object Also known as: exclusive?
Returns the value of attribute exclusive.
59 60 61 |
# File 'lib/amberletters.rb', line 59 def exclusive @exclusive end |
#interruption ⇒ Object
Returns the value of attribute interruption.
61 62 63 |
# File 'lib/amberletters.rb', line 61 def interruption @interruption end |
#logger ⇒ Object
Returns the value of attribute logger.
60 61 62 |
# File 'lib/amberletters.rb', line 60 def logger @logger end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
62 63 64 |
# File 'lib/amberletters.rb', line 62 def end |
#time_to_live ⇒ Object
Returns the value of attribute time_to_live.
58 59 60 |
# File 'lib/amberletters.rb', line 58 def time_to_live @time_to_live end |
Instance Method Details
#call(process) ⇒ Object
74 75 76 77 |
# File 'lib/amberletters.rb', line 74 def call(process) @block.call(self, process) true end |