Class: Inch::CLI::Command::BaseObject

Inherits:
Base
  • Object
show all
Defined in:
lib/inch/cli/command/base_object.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#source_parser

Instance Method Summary collapse

Methods inherited from Base

#description, #name, run, #usage

Methods included from TraceHelper

#debug, #trace, #trace_header

Constructor Details

#initializeBaseObject

Returns a new instance of BaseObject.



7
8
9
10
# File 'lib/inch/cli/command/base_object.rb', line 7

def initialize
  super
  @ranges = Evaluation.new_score_ranges
end

Instance Attribute Details

#objectObject

Returns the value of attribute object.



5
6
7
# File 'lib/inch/cli/command/base_object.rb', line 5

def object
  @object
end

#objectsObject

Returns the value of attribute objects.



5
6
7
# File 'lib/inch/cli/command/base_object.rb', line 5

def objects
  @objects
end

Instance Method Details

#prepare_objects(*args) ⇒ void

This method returns an undefined value.

Prepares the (list of) objects, parsing arguments and running the source parser.

Parameters:

  • args (Array<String>)

    the list of arguments.



17
18
19
20
21
22
23
24
# File 'lib/inch/cli/command/base_object.rb', line 17

def prepare_objects(*args)
  @options.parse(args)
  @options.verify
  run_source_parser(@options.paths, @options.excluded)

  self.objects = find_object_names(@options.object_names)
  self.object = @objects.first
end