Class: Corridor

Inherits:
Figure show all
Defined in:
lib/sitac_objects.rb

Overview

Represents a corridor, given its starting point, its ending point and its width

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from SITACObjects

#as_point

Constructor Details

#initialize(name, startpt, endpt, width) ⇒ Corridor

Returns a new instance of Corridor.

Parameters:

  • name (String)

    the name of the corridor

  • startpt (Point, Array)

    the starting point of the corridor

  • endpt (Point, Array)

    the ending point of the corridor

  • width (Float)

    the width of the corridor



163
164
165
166
167
168
169
# File 'lib/sitac_objects.rb', line 163

def initialize(name, startpt, endpt, width)
  super
  @name = name
  @start_point = as_point(startpt)
  @end_point = as_point(endpt)
  @width = width
end

Instance Attribute Details

#end_pointObject (readonly)

Returns the value of attribute end_point.



157
158
159
# File 'lib/sitac_objects.rb', line 157

def end_point
  @end_point
end

#nameObject (readonly)

Returns the value of attribute name.



157
158
159
# File 'lib/sitac_objects.rb', line 157

def name
  @name
end

#start_pointObject (readonly)

Returns the value of attribute start_point.



157
158
159
# File 'lib/sitac_objects.rb', line 157

def start_point
  @start_point
end

#widthObject (readonly)

Returns the value of attribute width.



157
158
159
# File 'lib/sitac_objects.rb', line 157

def width
  @width
end

Instance Method Details

#accept(visitor) ⇒ Object



171
172
173
# File 'lib/sitac_objects.rb', line 171

def accept(visitor)
  visitor.visit_corridor self
end