Class: Inch::Rake::Suggest

Inherits:
Rake::TaskLib
  • Object
show all
Defined in:
lib/inch/rake/suggest.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name = "inch", *args, &block) ⇒ Suggest

Returns a new instance of Suggest.

Parameters:

  • name (String) (defaults to: "inch")

    name of the Rake task

  • *args (Array)

    arguments to be passed to Suggest.run

  • &block (Proc)

    optional, evaluated inside the task definition



16
17
18
19
20
21
22
23
# File 'lib/inch/rake/suggest.rb', line 16

def initialize(name = "inch", *args, &block)
  @name = name
  @args = args
  block.call(self) if block

  desc "Suggest objects to add documention to"
  task(@name) { suggest }
end

Instance Attribute Details

#argsObject

Returns the value of attribute args.



11
12
13
# File 'lib/inch/rake/suggest.rb', line 11

def args
  @args
end

#nameObject

Returns the value of attribute name.



10
11
12
# File 'lib/inch/rake/suggest.rb', line 10

def name
  @name
end

Instance Method Details

#suggestObject



25
26
27
# File 'lib/inch/rake/suggest.rb', line 25

def suggest
  ::Inch::CLI::Command::Suggest.run(*@args)
end