Class: Rets::Metadata::TableFactory

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

Class Method Summary collapse

Class Method Details

.build(table_fragment, resource) ⇒ Object



4
5
6
# File 'lib/rets/metadata/table.rb', line 4

def self.build(table_fragment, resource)
  enum?(table_fragment) ? LookupTable.new(table_fragment, resource) : Table.new(table_fragment)
end

.enum?(table_fragment) ⇒ Boolean

Returns:

  • (Boolean)


8
9
10
11
12
13
# File 'lib/rets/metadata/table.rb', line 8

def self.enum?(table_fragment)
  lookup_value   = table_fragment["LookupName"].strip
  interpretation = table_fragment["Interpretation"].strip

  interpretation =~ /Lookup/ && !lookup_value.empty?
end