Class: DxfIO::Wrapper

Inherits:
Object
  • Object
show all
Defined in:
lib/dxf_io/wrapper.rb

Constant Summary collapse

SECTIONS_LIST =
DxfIO::Constants::SECTIONS_LIST
HEADER_NAME =
DxfIO::Constants::HEADER_NAME
ENTITIES_TYPE_NAME_VALUE_MAPPING =
DxfIO::Constants::ENTITIES_TYPE_NAME_VALUE_MAPPING

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Wrapper

Returns a new instance of Wrapper.



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/dxf_io/wrapper.rb', line 8

def initialize(options)
  if options.is_a? Hash
    if options[:dxf_hash].nil?
      @dxf_hash = options
    else
      @dxf_hash = options[:dxf_hash]
    end
  else
    raise ArgumentError, 'options must be a Hash'
  end
end

Instance Method Details

#fetch_entities(group_name) ⇒ Object



28
29
30
31
32
# File 'lib/dxf_io/wrapper.rb', line 28

def fetch_entities(group_name)
  @dxf_hash[group_name.upcase].collect do |entity_groups|
    to_proper_class(DxfIO::Entity::Other.new(entity_groups))
  end
end