Class: Trailblazer::Activity::End
- Inherits:
-
Object
- Object
- Trailblazer::Activity::End
- Defined in:
- lib/trailblazer/activity/structures.rb
Overview
Any instance of subclass of End will halt the circuit’s execution when hit. An End event is a simple structure typically found as the last task invoked in an activity. The special behavior is that it a) maintains a semantic that is used to further connect that very event b) its ‘End#call` method returns the end instance itself as the signal.
Direct Known Subclasses
Instance Method Summary collapse
- #call(args) ⇒ Object
-
#initialize(semantic:, **options) ⇒ End
constructor
A new instance of End.
- #to_h ⇒ Object
- #to_s ⇒ Object (also: #inspect)
Constructor Details
#initialize(semantic:, **options) ⇒ End
Returns a new instance of End.
11 12 13 |
# File 'lib/trailblazer/activity/structures.rb', line 11 def initialize(semantic:, **) @options = .merge(semantic: semantic) end |
Instance Method Details
#call(args) ⇒ Object
15 16 17 |
# File 'lib/trailblazer/activity/structures.rb', line 15 def call(args, **) return self, args end |
#to_h ⇒ Object
19 20 21 |
# File 'lib/trailblazer/activity/structures.rb', line 19 def to_h @options end |
#to_s ⇒ Object Also known as: inspect
23 24 25 |
# File 'lib/trailblazer/activity/structures.rb', line 23 def to_s %(#<#{self.class.name} #{@options.collect { |k, v| "#{k}=#{v.inspect}" }.join(" ")}>) end |