class Rugged::Repository::Attributes

Constants

LOAD_PRIORITIES

Public Class Methods

new(repository, path, options = {}) click to toggle source
# File lib/rugged/attributes.rb, line 27
def initialize(repository, path, options = {})
  @repository = repository
  @path = path
  @load_flags = Attributes.parse_opts(options)
end
parse_opts(opt) click to toggle source
# File lib/rugged/attributes.rb, line 21
def self.parse_opts(opt)
  flags = LOAD_PRIORITIES[opt[:priority]] || 0
  flags |= 4 if opt[:skip_system]
  flags
end

Public Instance Methods

[](attribute) click to toggle source
# File lib/rugged/attributes.rb, line 33
def [](attribute)
  @repository.fetch_attributes(@path, attribute, @load_flags)
end
each(&block) click to toggle source
# File lib/rugged/attributes.rb, line 41
def each(&block)
  to_h.each(&block)
end
to_h() click to toggle source
# File lib/rugged/attributes.rb, line 37
def to_h
  @hash ||= @repository.fetch_attributes(@path, nil, @load_flags)
end