Class: Reputation::Functions::Linear

Inherits:
Object
  • Object
show all
Includes:
Mixin
Defined in:
lib/reputation/functions/linear.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#mObject

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