Class: RuPov::Objects::FiniteSolidPrimitives::Cylinder

Inherits:
Base
  • Object
show all
Defined in:
lib/rupov.rb

Instance Attribute Summary

Attributes inherited from Base

#name

Instance Method Summary collapse

Methods inherited from Base

#<<

Constructor Details

#initialize(leftCentre, rightCentre, radius, open = false) {|_self| ... } ⇒ Cylinder

Returns a new instance of Cylinder.

Yields:

  • (_self)

Yield Parameters:



67
68
69
70
71
72
# File 'lib/rupov.rb', line 67

def initialize( leftCentre, rightCentre, radius, open = false )
    super( 'cylinder' )
    self << Methods::MultiValue.new([leftCentre,rightCentre,radius])
    @open = open
    yield(self) if block_given? and self.class == Cylinder
end

Instance Method Details

#to_sObject



73
74
75
76
77
78
# File 'lib/rupov.rb', line 73

def to_s
    self << "open" if @open
    result = super()
    self.pop() if @open
    result
end