Class: HelpTask
- Inherits:
-
Anvil::Task
- Object
- Anvil::Task
- HelpTask
- Defined in:
- lib/tasks/help_task.rb
Instance Attribute Summary collapse
-
#task_name ⇒ Object
readonly
Returns the value of attribute task_name.
Attributes inherited from Anvil::Task
Attributes included from Anvil::Task::Options
Instance Method Summary collapse
- #default_message ⇒ Object
-
#initialize(task_name, options = {}) ⇒ HelpTask
constructor
A new instance of HelpTask.
- #task ⇒ Object
Methods inherited from Anvil::Task
Methods included from Anvil::Task::ClassMethods
#after, #afters, #assure, #assures, #before, #befores, #descendants, #run
Methods included from Anvil::Task::Naming
#description, #from_name, #get_namespace
Methods included from Anvil::Task::Options
#build_parser, #configure_parser, #help, #parse_options!, #parser
Constructor Details
#initialize(task_name, options = {}) ⇒ HelpTask
12 13 14 |
# File 'lib/tasks/help_task.rb', line 12 def initialize(task_name, = {}) @task_name = task_name end |
Instance Attribute Details
#task_name ⇒ Object (readonly)
Returns the value of attribute task_name.
10 11 12 |
# File 'lib/tasks/help_task.rb', line 10 def task_name @task_name end |
Instance Method Details
#default_message ⇒ Object
22 23 24 |
# File 'lib/tasks/help_task.rb', line 22 def printf(self.class.help) end |
#task ⇒ Object
16 17 18 19 20 |
# File 'lib/tasks/help_task.rb', line 16 def task return unless task_name.present? klazz = Anvil::Task.from_name(task_name) printf(klazz.help) end |