class Tartarus::Registry
Attributes
storage[R]
Public Class Methods
new()
click to toggle source
# File lib/tartarus/registry.rb, line 11 def initialize reset end
Public Instance Methods
find_by_name(name)
click to toggle source
# File lib/tartarus/registry.rb, line 19 def find_by_name(name) storage.find(->{ raise "#{name} not found in registry" }) { |item| item.name == name } end
register(item)
click to toggle source
# File lib/tartarus/registry.rb, line 15 def register(item) @storage << item end
reset()
click to toggle source
# File lib/tartarus/registry.rb, line 23 def reset @storage = Concurrent::Array.new end