Class: MetricFu::Flog::ScannedMethod

Inherits:
Object
  • Object
show all
Defined in:
lib/generators/flog.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, score, operators = []) ⇒ ScannedMethod

Returns a new instance of ScannedMethod.



85
86
87
88
89
# File 'lib/generators/flog.rb', line 85

def initialize(name, score, operators = [])
  @name = name
  @score = score.to_f
  @operators = operators
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



83
84
85
# File 'lib/generators/flog.rb', line 83

def name
  @name
end

#operatorsObject

Returns the value of attribute operators.



83
84
85
# File 'lib/generators/flog.rb', line 83

def operators
  @operators
end

#scoreObject

Returns the value of attribute score.



83
84
85
# File 'lib/generators/flog.rb', line 83

def score
  @score
end

Instance Method Details

#to_hObject



91
92
93
94
95
# File 'lib/generators/flog.rb', line 91

def to_h
  {:name => @name,
   :score => @score,
   :operators => @operators.map {|o| o.to_h}}
end