Class: MacAppSync::Defaults::Save

Inherits:
Object
  • Object
show all
Defined in:
lib/mac_app_sync/defaults/save.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Save

Returns a new instance of Save.



10
11
12
# File 'lib/mac_app_sync/defaults/save.rb', line 10

def initialize(config)
  @domain_configs = parse_config(config)
end

Instance Attribute Details

#domain_configsObject (readonly)

Returns the value of attribute domain_configs.



4
5
6
# File 'lib/mac_app_sync/defaults/save.rb', line 4

def domain_configs
  @domain_configs
end

Class Method Details

.run(config) ⇒ Object



6
7
8
# File 'lib/mac_app_sync/defaults/save.rb', line 6

def self.run(config)
  new(config).run
end

Instance Method Details

#runObject



14
15
16
17
18
19
# File 'lib/mac_app_sync/defaults/save.rb', line 14

def run
  return if domain_configs.empty?

  persistence.reset!
  save_domains
end