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.
13 14 15 16 17 18 19 |
# File 'lib/mootool/command.rb', line 13 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.
7 8 9 |
# File 'lib/mootool/command.rb', line 7 def action @action end |
#controller ⇒ Object (readonly)
Returns the value of attribute controller.
7 8 9 |
# File 'lib/mootool/command.rb', line 7 def controller @controller end |
#file ⇒ Object (readonly)
Returns the value of attribute file.
7 8 9 |
# File 'lib/mootool/command.rb', line 7 def file @file end |
#output_format ⇒ Object (readonly)
Returns the value of attribute output_format.
7 8 9 |
# File 'lib/mootool/command.rb', line 7 def output_format @output_format end |
#remain ⇒ Object (readonly)
Returns the value of attribute remain.
7 8 9 |
# File 'lib/mootool/command.rb', line 7 def remain @remain end |
Class Method Details
.parse(args) ⇒ Object
9 10 11 |
# File 'lib/mootool/command.rb', line 9 def self.parse(args) Command.new args[2], :human, args[0], args[1], args[3..] end |
Instance Method Details
#run! ⇒ Object
21 22 23 24 25 26 |
# File 'lib/mootool/command.rb', line 21 def run! MooTool::ControllerBase.load_all controller = MooTool::ControllerBase.for_controller @controller controller.new.send @action, self, @remain end |