Class: Pressy::Command::Registry
- Inherits:
-
Object
- Object
- Pressy::Command::Registry
- Defined in:
- lib/pressy/command/registry.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Registry
constructor
A new instance of Registry.
- #lookup(name) ⇒ Object
- #register(type) ⇒ Object
Constructor Details
#initialize ⇒ Registry
Returns a new instance of Registry
2 3 4 |
# File 'lib/pressy/command/registry.rb', line 2 def initialize @commands = {} end |
Class Method Details
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 |