class Ak::Registry

Attributes

files[R]

Public Class Methods

new() click to toggle source
# File lib/ak.rb, line 11
def initialize
  @files = []
end

Public Instance Methods

find_by(type, value) click to toggle source
# File lib/ak.rb, line 24
def find_by(type, value)
  files.find { |file| file.send(type) == value }
end
load(path, **options) click to toggle source
# File lib/ak.rb, line 15
def load(path, **options)
  path = get_path(path)

  file = Ak::HotFile.new(path, options)
  file.load_file

  files.push(file)
end

Private Instance Methods

get_path(path) click to toggle source
# File lib/ak.rb, line 30
def get_path(path)
  path = "#{path}.rb" unless path.match(/.rb$/)
  return path if path.include?(Ak.root)
  "#{Ak.root}/#{path}"
end