Class: Inch::Rake::Suggest

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

Overview

Provides Rake task integration

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



20
21
22
23
24
25
26
27
# File 'lib/inch/rake/suggest.rb', line 20

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

#argsArray

Returns arguments to be passed to Suggest.run

Returns:

  • (Array)

    arguments to be passed to Suggest.run



15
16
17
# File 'lib/inch/rake/suggest.rb', line 15

def args
  @args
end

#nameString

Returns name of the Rake task

Returns:

  • (String)

    name of the Rake task



13
14
15
# File 'lib/inch/rake/suggest.rb', line 13

def name
  @name
end

Instance Method Details

#suggestvoid

This method returns an undefined value.



30
31
32
# File 'lib/inch/rake/suggest.rb', line 30

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