Class: Orchestra::Conductor::ServiceRecorder
- Inherits:
-
Object
- Object
- Orchestra::Conductor::ServiceRecorder
- Defined in:
- lib/orchestra/conductor.rb
Defined Under Namespace
Classes: Wrapper
Instance Attribute Summary collapse
-
#observable ⇒ Object
readonly
Returns the value of attribute observable.
Instance Method Summary collapse
- #<<(record) ⇒ Object
- #each(&block) ⇒ Object
-
#initialize(observable, service_name) ⇒ ServiceRecorder
constructor
A new instance of ServiceRecorder.
- #wrap(raw_service) ⇒ Object
Constructor Details
#initialize(observable, service_name) ⇒ ServiceRecorder
Returns a new instance of ServiceRecorder.
72 73 74 75 76 |
# File 'lib/orchestra/conductor.rb', line 72 def initialize observable, service_name @observable = observable @service_name = service_name @record = [] end |
Instance Attribute Details
#observable ⇒ Object (readonly)
Returns the value of attribute observable.
70 71 72 |
# File 'lib/orchestra/conductor.rb', line 70 def observable @observable end |
Instance Method Details
#<<(record) ⇒ Object
78 79 80 81 82 |
# File 'lib/orchestra/conductor.rb', line 78 def << record observable.changed observable.notify_observers :service_accessed, service_name, record @record << record end |
#each(&block) ⇒ Object
84 85 86 |
# File 'lib/orchestra/conductor.rb', line 84 def each &block @record.each &block end |