Class: Ncn::CommandResolver
- Inherits:
-
Object
- Object
- Ncn::CommandResolver
- Defined in:
- lib/ncn/command_resolver.rb
Constant Summary collapse
- COMMANDS =
%w[ create open list help ].freeze
Instance Attribute Summary collapse
-
#command ⇒ Object
readonly
Returns the value of attribute command.
Instance Method Summary collapse
- #command_class ⇒ Object
-
#initialize(command) ⇒ CommandResolver
constructor
A new instance of CommandResolver.
- #params_class ⇒ Object
Constructor Details
#initialize(command) ⇒ CommandResolver
Returns a new instance of CommandResolver.
12 13 14 |
# File 'lib/ncn/command_resolver.rb', line 12 def initialize(command) @command = command end |
Instance Attribute Details
#command ⇒ Object (readonly)
Returns the value of attribute command.
10 11 12 |
# File 'lib/ncn/command_resolver.rb', line 10 def command @command end |
Instance Method Details
#command_class ⇒ Object
16 17 18 |
# File 'lib/ncn/command_resolver.rb', line 16 def command_class Kernel.const_get("Ncn::Command::#{classified_command}") end |
#params_class ⇒ Object
20 21 22 |
# File 'lib/ncn/command_resolver.rb', line 20 def params_class Kernel.const_get("Ncn::CommandParams::#{classified_command}") end |