Class: Synced::Synchronizer
- Inherits:
-
Object
- Object
- Synced::Synchronizer
- Defined in:
- lib/synced/synchronizer.rb
Instance Attribute Summary collapse
-
#strategy ⇒ Object
readonly
Returns the value of attribute strategy.
Instance Method Summary collapse
-
#initialize(model_class, strategy:, **options) ⇒ Synchronizer
constructor
Initializes a new Synchronizer.
- #perform ⇒ Object
- #reset_synced ⇒ Object
Constructor Details
#initialize(model_class, strategy:, **options) ⇒ Synchronizer
Initializes a new Synchronizer
48 49 50 51 52 53 |
# File 'lib/synced/synchronizer.rb', line 48 def initialize(model_class, strategy:, **) @model_class = model_class @only_updated = [:only_updated] @remote = [:remote] @strategy = strategy_class(strategy).new(model_class, ) end |
Instance Attribute Details
#strategy ⇒ Object (readonly)
Returns the value of attribute strategy.
11 12 13 |
# File 'lib/synced/synchronizer.rb', line 11 def strategy @strategy end |
Instance Method Details
#perform ⇒ Object
55 56 57 |
# File 'lib/synced/synchronizer.rb', line 55 def perform @strategy.perform end |
#reset_synced ⇒ Object
59 60 61 |
# File 'lib/synced/synchronizer.rb', line 59 def reset_synced @strategy.reset_synced end |