Class: AsciiBinderGabrielRH::SiteMap

Inherits:
Object
  • Object
show all
Defined in:
lib/ascii_binder_gabriel_rh/site_map.rb

Instance Method Summary collapse

Constructor Details

#initialize(distro_map) ⇒ SiteMap

Returns a new instance of SiteMap.



5
6
7
8
9
10
11
12
13
14
# File 'lib/ascii_binder_gabriel_rh/site_map.rb', line 5

def initialize(distro_map)
  @site_map = {}
  distro_map.distros.each do |distro|
    unless @site_map.has_key?(distro.site.id)
      @site_map[distro.site.id] = AsciiBinderGabrielRH::SiteInfo.new(distro)
    else
      @site_map[distro.site.id].add_distro(distro)
    end
  end
end

Instance Method Details

#idsObject



20
21
22
# File 'lib/ascii_binder_gabriel_rh/site_map.rb', line 20

def ids
  return @site_map.keys
end

#sitesObject



16
17
18
# File 'lib/ascii_binder_gabriel_rh/site_map.rb', line 16

def sites
  return @site_map.values
end