Module: Capricorn::System::Satellites

Included in:
Capricorn::System
Defined in:
lib/capricorn/system/satellites.rb

Instance Method Summary collapse

Instance Method Details

#destroy_satellite!(satellite) ⇒ Object



23
24
25
26
# File 'lib/capricorn/system/satellites.rb', line 23

def destroy_satellite!(satellite)
  satellites_hash.delete(satellite.domain)
  FileUtils.rm_f(self.path('satellites', "#{satellite.domain}.yml"))
end

#find_satellite(domain) ⇒ Object



14
15
16
# File 'lib/capricorn/system/satellites.rb', line 14

def find_satellite(domain)
  satellites_hash[domain]
end

#satellitesObject



10
11
12
# File 'lib/capricorn/system/satellites.rb', line 10

def satellites
  satellites_hash.values
end

#satellites_hashObject



6
7
8
# File 'lib/capricorn/system/satellites.rb', line 6

def satellites_hash
  @satellites || load_satellites
end

#save_satellite!(satellite) ⇒ Object



18
19
20
21
# File 'lib/capricorn/system/satellites.rb', line 18

def save_satellite!(satellite)
  satellites_hash[satellite.domain] = satellite
  satellite.dump_file(self.path('satellites', "#{satellite.domain}.yml"))
end