Class: Errands::Receptors::Receptor
- Inherits:
-
Array
- Object
- Array
- Errands::Receptors::Receptor
- Includes:
- Track, ThreadAccessor::PrivateAccess
- Defined in:
- lib/errands/runner.rb
Defined Under Namespace
Modules: Track
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #<<(value) ⇒ Object
-
#initialize(name) ⇒ Receptor
constructor
A new instance of Receptor.
- #shift(*_) ⇒ Object
Methods included from Track
Methods included from ThreadAccessor::PrivateAccess
Constructor Details
#initialize(name) ⇒ Receptor
Returns a new instance of Receptor.
102 103 104 |
# File 'lib/errands/runner.rb', line 102 def initialize(name) @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
100 101 102 |
# File 'lib/errands/runner.rb', line 100 def name @name end |
Instance Method Details
#<<(value) ⇒ Object
110 111 112 113 114 |
# File 'lib/errands/runner.rb', line 110 def <<(value) return if value.nil? track value, my[:receptor_track] if my super.tap { our[:threads][@name] && our[:threads][@name].run } end |
#shift(*_) ⇒ Object
106 107 108 |
# File 'lib/errands/runner.rb', line 106 def shift(*_) my[:data] = super.tap { |value| my.merge! receptor_track: track(value), latency: empty? } end |