Class: Reviewer::Setup::Detector::Source

Inherits:
Struct
  • Object
show all
Defined in:
lib/reviewer/setup/detector.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#kindObject

Returns the value of attribute kind

Returns:

  • (Object)

    the current value of kind



8
9
10
# File 'lib/reviewer/setup/detector.rb', line 8

def kind
  @kind
end

#locationObject

Returns the value of attribute location

Returns:

  • (Object)

    the current value of location



8
9
10
# File 'lib/reviewer/setup/detector.rb', line 8

def location
  @location
end

#pathObject

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



8
9
10
# File 'lib/reviewer/setup/detector.rb', line 8

def path
  @path
end

Instance Method Details

#descriptionObject



9
10
11
12
13
14
15
# File 'lib/reviewer/setup/detector.rb', line 9

def description
  case kind
  when :dependency then "#{location} in #{path}"
  when :directory then "#{path}/ directory"
  else path
  end
end

#to_hObject



17
18
19
20
21
# File 'lib/reviewer/setup/detector.rb', line 17

def to_h
  source = { path: path }
  source[:location] = location if location
  { kind: kind, source: source }
end