Class: MetricFu::Flog::ScannedMethod
- Inherits:
-
Object
- Object
- MetricFu::Flog::ScannedMethod
- Defined in:
- lib/generators/flog.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#operators ⇒ Object
Returns the value of attribute operators.
-
#score ⇒ Object
Returns the value of attribute score.
Instance Method Summary collapse
-
#initialize(name, score, operators = []) ⇒ ScannedMethod
constructor
A new instance of ScannedMethod.
- #to_h ⇒ Object
Constructor Details
#initialize(name, score, operators = []) ⇒ ScannedMethod
Returns a new instance of ScannedMethod.
125 126 127 128 129 |
# File 'lib/generators/flog.rb', line 125 def initialize(name, score, operators = []) @name = name @score = score.to_f @operators = operators end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
123 124 125 |
# File 'lib/generators/flog.rb', line 123 def name @name end |
#operators ⇒ Object
Returns the value of attribute operators.
123 124 125 |
# File 'lib/generators/flog.rb', line 123 def operators @operators end |
#score ⇒ Object
Returns the value of attribute score.
123 124 125 |
# File 'lib/generators/flog.rb', line 123 def score @score end |
Instance Method Details
#to_h ⇒ Object
131 132 133 134 135 |
# File 'lib/generators/flog.rb', line 131 def to_h {:name => @name, :score => @score, :operators => @operators.map {|o| o.to_h}} end |