Class: Cobplexity::Metric

Inherits:
Object
  • Object
show all
Defined in:
lib/cobplexity/analyzer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeMetric

Returns a new instance of Metric.



41
42
43
# File 'lib/cobplexity/analyzer.rb', line 41

def initialize
  @categories = []
end

Instance Attribute Details

#categoriesObject

Returns the value of attribute categories.



40
41
42
# File 'lib/cobplexity/analyzer.rb', line 40

def categories
  @categories
end

#colorObject

Returns the value of attribute color.



40
41
42
# File 'lib/cobplexity/analyzer.rb', line 40

def color
  @color
end

#sizeObject

Returns the value of attribute size.



40
41
42
# File 'lib/cobplexity/analyzer.rb', line 40

def size
  @size
end

Instance Method Details

#to_sObject



44
45
46
47
48
49
# File 'lib/cobplexity/analyzer.rb', line 44

def to_s
  categories = @categories.collect do |category|
    category.delete '",'
  end
  "#{@size},#{@color},#{categories.join ','}"
end