Class: PagerJudy::Sync::Syncer
- Inherits:
-
Object
- Object
- PagerJudy::Sync::Syncer
- Defined in:
- lib/pager_judy/sync/syncer.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
-
#initialize(client:, config:) ⇒ Syncer
constructor
A new instance of Syncer.
- #sync ⇒ Object
Constructor Details
#initialize(client:, config:) ⇒ Syncer
Returns a new instance of Syncer.
6 7 8 9 |
# File 'lib/pager_judy/sync/syncer.rb', line 6 def initialize(client:, config:) @client = client @config = config end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
11 12 13 |
# File 'lib/pager_judy/sync/syncer.rb', line 11 def client @client end |
#config ⇒ Object (readonly)
Returns the value of attribute config.
12 13 14 |
# File 'lib/pager_judy/sync/syncer.rb', line 12 def config @config end |
Instance Method Details
#sync ⇒ Object
14 15 16 17 18 |
# File 'lib/pager_judy/sync/syncer.rb', line 14 def sync config.services.each do |name, detail| client.services.create_or_update_by_name(name, detail.to_h) end end |