Class: Slate::Calculation::Base
- Inherits:
-
Object
- Object
- Slate::Calculation::Base
- Defined in:
- lib/slate/calculation.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(graph) ⇒ Base
constructor
A new instance of Base.
- #result ⇒ Object
Constructor Details
#initialize(graph) ⇒ Base
Returns a new instance of Base.
20 21 22 |
# File 'lib/slate/calculation.rb', line 20 def initialize(graph) @graph = graph end |
Class Method Details
.description(description = nil) ⇒ Object
15 16 17 18 |
# File 'lib/slate/calculation.rb', line 15 def self.description(description=nil) return @description if description.nil? @description = description end |
.name(name = nil) ⇒ Object
10 11 12 13 |
# File 'lib/slate/calculation.rb', line 10 def self.name(name=nil) return @name if name.nil? @name = name end |
Instance Method Details
#result ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/slate/calculation.rb', line 24 def result targets.map do |target| name = target.first points = target.last target name, map(points) end end |