Class: Watchr::SmellBuilder

Inherits:
Object
  • Object
show all
Includes:
SmellTypes
Defined in:
lib/watchr/smell_builder.rb

Constant Summary

Constants included from SmellTypes

Watchr::SmellTypes::ALL_SMELLS

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, context, description) ⇒ SmellBuilder

Returns a new instance of SmellBuilder.



10
11
12
13
14
# File 'lib/watchr/smell_builder.rb', line 10

def initialize(type, context, description)
  assert_valid_smell_type(type)

  @smell = Smell.new(type, context, description)
end

Instance Attribute Details

#smellObject (readonly)

Returns the value of attribute smell.



8
9
10
# File 'lib/watchr/smell_builder.rb', line 8

def smell
  @smell
end

Instance Method Details

#add_details(details) ⇒ Object



20
21
22
# File 'lib/watchr/smell_builder.rb', line 20

def add_details(details)
  @smell.details = details
end

#add_location(file, line) ⇒ Object



16
17
18
# File 'lib/watchr/smell_builder.rb', line 16

def add_location(file, line)
  @smell.add_location(Location.new(file, line))
end