Class: ImpExp::PingObserver
- Inherits:
-
Object
- Object
- ImpExp::PingObserver
- Defined in:
- app/services/imp_exp/ping_observer.rb
Instance Attribute Summary collapse
-
#active_record_import ⇒ Object
readonly
Returns the value of attribute active_record_import.
-
#import_service ⇒ Object
readonly
Returns the value of attribute import_service.
Instance Method Summary collapse
-
#initialize(import_service, active_record_import) ⇒ PingObserver
constructor
A new instance of PingObserver.
- #setup ⇒ Object
- #update(data_hash) ⇒ Object
Constructor Details
#initialize(import_service, active_record_import) ⇒ PingObserver
Returns a new instance of PingObserver.
7 8 9 10 |
# File 'app/services/imp_exp/ping_observer.rb', line 7 def initialize(import_service, active_record_import) @import_service = import_service @active_record_import = active_record_import end |
Instance Attribute Details
#active_record_import ⇒ Object (readonly)
Returns the value of attribute active_record_import.
5 6 7 |
# File 'app/services/imp_exp/ping_observer.rb', line 5 def active_record_import @active_record_import end |
#import_service ⇒ Object (readonly)
Returns the value of attribute import_service.
5 6 7 |
# File 'app/services/imp_exp/ping_observer.rb', line 5 def import_service @import_service end |
Instance Method Details
#setup ⇒ Object
12 13 14 15 16 |
# File 'app/services/imp_exp/ping_observer.rb', line 12 def setup import_service.importers.each do |importer| importer.add_observer(self) end end |
#update(data_hash) ⇒ Object
18 19 20 |
# File 'app/services/imp_exp/ping_observer.rb', line 18 def update(data_hash) active_record_import.ping(**data_hash) end |