Module: Pulo::Figure2D
- Includes:
- Quantity_Checker
- Defined in:
- lib/pulo/figure/figure2d.rb
Instance Attribute Summary collapse
-
#area ⇒ Object
readonly
Returns the value of attribute area.
-
#perimeter ⇒ Object
readonly
Returns the value of attribute perimeter.
Instance Method Summary collapse
Methods included from Quantity_Checker
Instance Attribute Details
#area ⇒ Object (readonly)
Returns the value of attribute area.
6 7 8 |
# File 'lib/pulo/figure/figure2d.rb', line 6 def area @area end |
#perimeter ⇒ Object (readonly)
Returns the value of attribute perimeter.
6 7 8 |
# File 'lib/pulo/figure/figure2d.rb', line 6 def perimeter @perimeter end |
Instance Method Details
#*(other) ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/pulo/figure/figure2d.rb', line 7 def * (other) if other.is_a?(Length) raise "No extrusion figure known for #{self.class}" unless self.respond_to?(:extrusion_figure) self.extrusion_figure.new(face: self, length: other) else raise "Dont know how to multiply a #{self.class} by a #{other.class}" end end |