Class: Emit::OutputGuard
- Inherits:
-
Object
- Object
- Emit::OutputGuard
- Defined in:
- lib/emit/output_guard.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#channel_end ⇒ Object
readonly
Returns the value of attribute channel_end.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
Instance Method Summary collapse
-
#initialize(argument, message, action = nil) ⇒ OutputGuard
constructor
A new instance of OutputGuard.
Constructor Details
#initialize(argument, message, action = nil) ⇒ OutputGuard
Returns a new instance of OutputGuard.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/emit/output_guard.rb', line 5 def initialize(argument, , action=nil) case argument when OutputGuard @channel_end, , @action = argument.channel_end, argument., argument.action when ChannelEndWrite @channel_end, , @action = argument, , action when Array fail "Wrong number of arguments" unless argument.size == 3 @channel_end, , @action = argument else fail "Unknown output guard type" end fail "OutputGuard must have a writing channel end." unless ChannelEndWrite === channel_end fail "OutputGuard action cannot be nil" if @action.nil? end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
3 4 5 |
# File 'lib/emit/output_guard.rb', line 3 def action @action end |
#channel_end ⇒ Object (readonly)
Returns the value of attribute channel_end.
3 4 5 |
# File 'lib/emit/output_guard.rb', line 3 def channel_end @channel_end end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
3 4 5 |
# File 'lib/emit/output_guard.rb', line 3 def end |