Class: MetricFu::Flog::Operator
- Inherits:
-
Object
- Object
- MetricFu::Flog::Operator
- Defined in:
- lib/generators/flog.rb
Instance Attribute Summary collapse
-
#operator ⇒ Object
Returns the value of attribute operator.
-
#score ⇒ Object
Returns the value of attribute score.
Instance Method Summary collapse
-
#initialize(score, operator) ⇒ Operator
constructor
A new instance of Operator.
- #to_h ⇒ Object
Constructor Details
#initialize(score, operator) ⇒ Operator
Returns a new instance of Operator.
112 113 114 115 |
# File 'lib/generators/flog.rb', line 112 def initialize(score, operator) @score = score.to_f @operator = operator end |
Instance Attribute Details
#operator ⇒ Object
Returns the value of attribute operator.
110 111 112 |
# File 'lib/generators/flog.rb', line 110 def operator @operator end |
#score ⇒ Object
Returns the value of attribute score.
110 111 112 |
# File 'lib/generators/flog.rb', line 110 def score @score end |
Instance Method Details
#to_h ⇒ Object
117 118 119 |
# File 'lib/generators/flog.rb', line 117 def to_h {:score => @score, :operator => @operator} end |