Class: MooTool::Command
- Inherits:
-
Object
- Object
- MooTool::Command
- Defined in:
- lib/mootool/command.rb
Overview
Abstract base command for all command types.
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#controller ⇒ Object
readonly
Returns the value of attribute controller.
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#output_format ⇒ Object
readonly
Returns the value of attribute output_format.
-
#remain ⇒ Object
readonly
Returns the value of attribute remain.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(file, _output_format, controller, action, remain) ⇒ Command
constructor
A new instance of Command.
- #run! ⇒ Object
Constructor Details
#initialize(file, _output_format, controller, action, remain) ⇒ Command
Returns a new instance of Command.
12 13 14 15 16 17 18 |
# File 'lib/mootool/command.rb', line 12 def initialize(file, _output_format, controller, action, remain) @file = file @controller = controller @output_format = :human @remain = remain @action = action end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
6 7 8 |
# File 'lib/mootool/command.rb', line 6 def action @action end |
#controller ⇒ Object (readonly)
Returns the value of attribute controller.
6 7 8 |
# File 'lib/mootool/command.rb', line 6 def controller @controller end |
#file ⇒ Object (readonly)
Returns the value of attribute file.
6 7 8 |
# File 'lib/mootool/command.rb', line 6 def file @file end |
#output_format ⇒ Object (readonly)
Returns the value of attribute output_format.
6 7 8 |
# File 'lib/mootool/command.rb', line 6 def output_format @output_format end |
#remain ⇒ Object (readonly)
Returns the value of attribute remain.
6 7 8 |
# File 'lib/mootool/command.rb', line 6 def remain @remain end |
Class Method Details
.parse(args) ⇒ Object
8 9 10 |
# File 'lib/mootool/command.rb', line 8 def self.parse(args) Command.new args[2], :human, args[0], args[1], args[3..] end |
Instance Method Details
#run! ⇒ Object
20 21 22 23 24 25 |
# File 'lib/mootool/command.rb', line 20 def run! MooTool::ControllerBase.load_all controller = MooTool::ControllerBase.for_controller @controller controller.new.send @action, self, @remain end |