Class: Dxf::FloorPlan::Block

Inherits:
Object
  • Object
show all
Defined in:
lib/dxf/floor_plan.rb

Overview

Generic rectangular fixture in a Dxf::FloorPlan — a piece of
furniture or built-in (toilet, vanity, tub, etc.) with position,
rotation, dimensions, and optional attached comment annotations.

Direct Known Subclasses

Bidet

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(fixture_hash) ⇒ Block

Returns a new instance of Block.



360
361
362
363
364
365
366
367
368
369
# File 'lib/dxf/floor_plan.rb', line 360

def initialize(fixture_hash)
  @x = fixture_hash['@x']
  @y = fixture_hash['@y']
  @length = fixture_hash['@length']
  @width = fixture_hash['@width']
  @rot = fixture_hash['@rotation']
  @fixture_name = fixture_hash['@linkage']
  @comments = fixture_hash['@comments']
  @rot = -1 * rot.to_i
end

Instance Attribute Details

#commentsObject (readonly)

Returns the value of attribute comments.



358
359
360
# File 'lib/dxf/floor_plan.rb', line 358

def comments
  @comments
end

#fixture_nameObject (readonly)

Returns the value of attribute fixture_name.



358
359
360
# File 'lib/dxf/floor_plan.rb', line 358

def fixture_name
  @fixture_name
end

#lengthObject (readonly)

Returns the value of attribute length.



358
359
360
# File 'lib/dxf/floor_plan.rb', line 358

def length
  @length
end

#rotObject (readonly)

Returns the value of attribute rot.



358
359
360
# File 'lib/dxf/floor_plan.rb', line 358

def rot
  @rot
end

#widthObject (readonly)

Returns the value of attribute width.



358
359
360
# File 'lib/dxf/floor_plan.rb', line 358

def width
  @width
end

#xObject (readonly)

Returns the value of attribute x.



358
359
360
# File 'lib/dxf/floor_plan.rb', line 358

def x
  @x
end

#yObject (readonly)

Returns the value of attribute y.



358
359
360
# File 'lib/dxf/floor_plan.rb', line 358

def y
  @y
end

Class Method Details

.build_and_initialize_fixture(fixture_hash) ⇒ String

Returns the classified fixture linkage name.

Returns:

  • (String)

    the classified fixture linkage name



372
373
374
# File 'lib/dxf/floor_plan.rb', line 372

def self.build_and_initialize_fixture(fixture_hash)
  fixture_hash['@linkage'].classify
end