Class: Cylinder
Instance Attribute Summary collapse
-
#dia ⇒ Object
Returns the value of attribute dia.
-
#height ⇒ Object
Returns the value of attribute height.
Instance Method Summary collapse
-
#initialize(height, dia) ⇒ Cylinder
constructor
A new instance of Cylinder.
- #radius ⇒ Object
Methods inherited from Shape
#*, #+, #-, #bbox, #extrude, #max_x, #max_y, #max_z, #min_x, #min_y, #min_z, #move_x, #move_y, #move_z, #render, #revolve, #rot_x, #rot_y, #rot_z, #scale_x, #scale_y, #scale_z, #x_size, #y_size, #z_size, #~@
Constructor Details
#initialize(height, dia) ⇒ Cylinder
Returns a new instance of Cylinder.
281 282 283 284 |
# File 'lib/rcad.rb', line 281 def initialize(height, dia) @height = height @dia = dia end |
Instance Attribute Details
#dia ⇒ Object
Returns the value of attribute dia.
279 280 281 |
# File 'lib/rcad.rb', line 279 def dia @dia end |
#height ⇒ Object
Returns the value of attribute height.
279 280 281 |
# File 'lib/rcad.rb', line 279 def height @height end |
Instance Method Details
#radius ⇒ Object
286 287 288 |
# File 'lib/rcad.rb', line 286 def radius dia / 2.0 end |