Class: DXF::Entity
Overview
Entity is the base class for everything that can live in the ENTITIES block
Constant Summary collapse
- TypeError =
Class.new(StandardError)
Instance Attribute Summary collapse
-
#handle ⇒ Object
Returns the value of attribute handle.
-
#layer ⇒ Object
Returns the value of attribute layer.
Class Method Summary collapse
Instance Method Summary collapse
Methods included from ClusterFactory
Instance Attribute Details
#handle ⇒ Object
Returns the value of attribute handle.
12 13 14 |
# File 'lib/dxf/entity.rb', line 12 def handle @handle end |
#layer ⇒ Object
Returns the value of attribute layer.
13 14 15 |
# File 'lib/dxf/entity.rb', line 13 def layer @layer end |
Class Method Details
.new(type) ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/dxf/entity.rb', line 15 def self.new(type) case type when 'CIRCLE' then Circle.new when 'LINE' then Line.new else raise TypeError, "Unrecognized entity type '#{type}'" end end |
Instance Method Details
#parse_pair(code, value) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/dxf/entity.rb', line 24 def parse_pair(code, value) # Handle group codes that are common to all entities # These are from the table that starts on page 70 of specification case code when '5' handle = value when '8' layer = value else p "Unrecognized entity group code: #{code} #{value}" end end |