Class: Rets::Metadata::TableFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/rets/metadata/table_factory.rb

Class Method Summary collapse

Class Method Details

.build(table_fragment, resource_id, lookup_types) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/rets/metadata/table_factory.rb', line 5

def self.build(table_fragment, resource_id, lookup_types)
  if table_fragment["LookupName"].empty?
    Table.new(table_fragment, resource_id)
  else
    if table_fragment["Interpretation"] == "LookupMulti"
      MultiLookupTable.build(table_fragment, resource_id, lookup_types)
    else
      LookupTable.build(table_fragment, resource_id, lookup_types)
    end
  end
end