class Lsgh::User

Attributes

name[R]

Public Class Methods

new(name) click to toggle source
# File lib/lsgh/user.rb, line 5
def initialize(name)
  @name = name
  @public = []
  @private = []
end

Public Instance Methods

add(repo) click to toggle source
# File lib/lsgh/user.rb, line 11
def add(repo)
  case repo.type
  when :public
    @public << repo
  when :private
    @private << repo
  end
end
to_paths() click to toggle source
# File lib/lsgh/user.rb, line 20
def to_paths
  [
    ['public', @public],
    ['private', @private]
  ].map do |type, value|
    value.map do |repo|
      repo.to_paths.map do |path|
        "#{@name}/#{type}/#{path}"
      end
    end.inject(:+).to_a
  end.inject(:+)
end