Class: TextmateRush::Command
- Inherits:
-
Object
- Object
- TextmateRush::Command
- Includes:
- TextmateHelper
- Defined in:
- lib/textmate_rush/command.rb
Instance Attribute Summary collapse
-
#shell ⇒ Object
Returns the value of attribute shell.
Instance Method Summary collapse
- #execute(thing) ⇒ Object
-
#initialize ⇒ Command
constructor
A new instance of Command.
- #method_missing(sym, *args, &block) ⇒ Object
- #run(&block) ⇒ Object
Methods included from TextmateHelper
#tm_current_word, #tm_directory, #tm_file, #tm_filename, #tm_project_directory
Constructor Details
#initialize ⇒ Command
Returns a new instance of Command.
5 6 7 |
# File 'lib/textmate_rush/command.rb', line 5 def initialize() self.shell = Rush::Shell.new end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(sym, *args, &block) ⇒ Object
18 19 20 |
# File 'lib/textmate_rush/command.rb', line 18 def method_missing(sym, *args, &block) execute sym.to_s end |
Instance Attribute Details
#shell ⇒ Object
Returns the value of attribute shell.
4 5 6 |
# File 'lib/textmate_rush/command.rb', line 4 def shell @shell end |
Instance Method Details
#execute(thing) ⇒ Object
13 14 15 16 |
# File 'lib/textmate_rush/command.rb', line 13 def execute(thing) shell.execute(thing) $last_res end |
#run(&block) ⇒ Object
9 10 11 |
# File 'lib/textmate_rush/command.rb', line 9 def run(&block) self.instance_eval(&block) end |