Sha256: fe7a70d47041efc62891aaf41b5d4e71840fb8dbe0a63a54f541efe9f5676fc5

Contents?: true

Size: 517 Bytes

Versions: 4

Compression:

Stored size: 517 Bytes

Contents

module AsciiBinder
  class SiteInfo
    attr_reader :id, :name, :url, :distros, :branches

    def initialize(distro)
      @id       = distro.site.id
      @name     = distro.site.name
      @url      = distro.site.url
      @distros  = {}
      @branches = ['main']
      add_distro(distro)
    end

    def add_distro(distro)
      @distros[distro.id] = distro.branches
      distro.branches.each do |branch|
        next if @branches.include?(branch.id)
        @branches << branch.id
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ascii_binder-1.2 lib/ascii_binder/site_info.rb
ascii_binder-1.0.1 lib/ascii_binder/site_info.rb
ascii_binder-1.0 lib/ascii_binder/site_info.rb
ascii_binder-0.2.3 lib/ascii_binder/site_info.rb