Class: Inch::CLI::Command::BaseList Abstract

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

Overview

This class is abstract.

Base class for Command objects concerned with lists of objects

Commands subclassing from this class are called with an optional list of paths in the form:

$ inch COMMAND [paths] [options]

Direct Known Subclasses

List, Options::List, Options::Stats, Options::Suggest

Instance Attribute Summary collapse

Attributes inherited from Base

#source_parser

Instance Method Summary collapse

Methods inherited from Base

#description, #name, run, #run, #usage

Methods included from TraceHelper

#debug, #trace, #trace_header

Constructor Details

#initializeBaseList

Returns a new instance of BaseList.



15
16
17
18
# File 'lib/inch/cli/command/base_list.rb', line 15

def initialize
  super
  @ranges = Evaluation.new_score_ranges
end

Instance Attribute Details

#objects=(value) ⇒ Object

Sets the attribute objects

Parameters:

  • value

    the value to set the attribute objects to.



13
14
15
# File 'lib/inch/cli/command/base_list.rb', line 13

def objects=(value)
  @objects = value
end

Instance Method Details

#prepare_list(*args) ⇒ void

This method returns an undefined value.

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

Parameters:

  • *args (Array<String>)

    the list of arguments.



25
26
27
28
29
30
31
# File 'lib/inch/cli/command/base_list.rb', line 25

def prepare_list(*args)
  @options.parse(args)
  @options.verify
  run_source_parser(@options.paths, @options.excluded)
  filter_objects
  assign_objects_to_ranges
end