Class: Reputation::Functions::Linear
- Inherits:
-
Object
- Object
- Reputation::Functions::Linear
- Includes:
- Mixin
- Defined in:
- lib/reputation/functions/linear.rb
Instance Attribute Summary collapse
-
#m ⇒ Object
Returns the value of attribute m.
Instance Method Summary collapse
- #f(x) ⇒ Object
-
#initialize(args = {}) ⇒ Linear
constructor
A new instance of Linear.
Methods included from Mixin
#google_chart, #google_chart_url
Constructor Details
#initialize(args = {}) ⇒ Linear
Returns a new instance of Linear.
9 10 11 12 |
# File 'lib/reputation/functions/linear.rb', line 9 def initialize(args = {}) constants = { :m => 1 }.merge( args ) @m = constants[:m] end |
Instance Attribute Details
#m ⇒ Object
Returns the value of attribute m.
7 8 9 |
# File 'lib/reputation/functions/linear.rb', line 7 def m @m end |
Instance Method Details
#f(x) ⇒ Object
14 15 16 |
# File 'lib/reputation/functions/linear.rb', line 14 def f(x) limit x * m end |