Class: Ak::Registry

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRegistry

Returns a new instance of Registry.



11
12
13
# File 'lib/ak.rb', line 11

def initialize
  @files = []
end

Instance Attribute Details

#filesObject (readonly)

Returns the value of attribute files.



9
10
11
# File 'lib/ak.rb', line 9

def files
  @files
end

Instance Method Details

#find_by(type, value) ⇒ Object



24
25
26
# File 'lib/ak.rb', line 24

def find_by(type, value)
  files.find { |file| file.send(type) == value }
end

#load(path, **options) ⇒ Object



15
16
17
18
19
20
21
22
# 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