Class: Sake::TasksArray
- Inherits:
-
Array
- Object
- Array
- Sake::TasksArray
- Defined in:
- lib/sake.rb
Overview
Instance Method Summary collapse
-
#[](name_or_index) ⇒ Object
Accepts a task name or index.
-
#to_ruby ⇒ Object
The source of all these tasks.
Instance Method Details
#[](name_or_index) ⇒ Object
Accepts a task name or index.
292 293 294 295 296 297 298 |
# File 'lib/sake.rb', line 292 def [](name_or_index) if name_or_index.is_a? String detect { |task| task.name == name_or_index } else super end end |
#to_ruby ⇒ Object
The source of all these tasks.
302 303 304 |
# File 'lib/sake.rb', line 302 def to_ruby map { |task| task.to_ruby }.join("\n") end |