Class: MetricFu::Flog::Operator

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(score, operator) ⇒ Operator

Returns a new instance of Operator.



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

def initialize(score, operator)
  @score = score.to_f
  @operator = operator
end

Instance Attribute Details

#operatorObject

Returns the value of attribute operator.



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

def operator
  @operator
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



90
91
92
# File 'lib/generators/flog.rb', line 90

def to_h
  {:score => @score, :operator => @operator}
end