Class: Inetmgr::InetmgrTask
- Inherits:
-
Rake::TaskLib
- Object
- Rake::TaskLib
- Inetmgr::InetmgrTask
- Defined in:
- lib/rake/inetmgrtask.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
- #call_task_block(obj) ⇒ Object
- #define(name, args) ⇒ Object
-
#initialize(name, *args, &block) ⇒ InetmgrTask
constructor
A new instance of InetmgrTask.
Constructor Details
#initialize(name, *args, &block) ⇒ InetmgrTask
Returns a new instance of InetmgrTask.
8 9 10 11 12 |
# File 'lib/rake/inetmgrtask.rb', line 8 def initialize(name, *args, &block) @block = block args = args.insert(0, name) define name, args end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
6 7 8 |
# File 'lib/rake/inetmgrtask.rb', line 6 def name @name end |
Instance Method Details
#call_task_block(obj) ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/rake/inetmgrtask.rb', line 21 def call_task_block(obj) if !@block.nil? if @block.arity == 1 @block.call(obj) else @block.call(obj, @task_args) end end end |
#define(name, args) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/rake/inetmgrtask.rb', line 14 def define(name, args) task *args do |task, task_args| @task_args = task_args execute name.to_s end end |