Class: Pressy::Command::Registry

Inherits:
Object
  • Object
show all
Defined in:
lib/pressy/command/registry.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRegistry

Returns a new instance of Registry



2
3
4
# File 'lib/pressy/command/registry.rb', line 2

def initialize
  @commands = {}
end

Class Method Details

.defaultObject



14
15
16
# File 'lib/pressy/command/registry.rb', line 14

def self.default
  @default_registry ||= Pressy::Command::Registry.new
end

Instance Method Details

#lookup(name) ⇒ Object



10
11
12
# File 'lib/pressy/command/registry.rb', line 10

def lookup(name)
  @commands[name]
end

#register(type) ⇒ Object



6
7
8
# File 'lib/pressy/command/registry.rb', line 6

def register(type)
  @commands[type.name] = type
end