Class: Rets::Metadata::Table

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(table_fragment) ⇒ Table

Returns a new instance of Table.



21
22
23
24
25
# File 'lib/rets/metadata/table.rb', line 21

def initialize(table_fragment)
  self.table_fragment = table_fragment
  self.type = table_fragment["DataType"]
  self.name = table_fragment["SystemName"]
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



18
19
20
# File 'lib/rets/metadata/table.rb', line 18

def name
  @name
end

#table_fragmentObject

Returns the value of attribute table_fragment.



19
20
21
# File 'lib/rets/metadata/table.rb', line 19

def table_fragment
  @table_fragment
end

#typeObject

Returns the value of attribute type.



17
18
19
# File 'lib/rets/metadata/table.rb', line 17

def type
  @type
end

Instance Method Details



27
28
29
30
31
32
33
34
# File 'lib/rets/metadata/table.rb', line 27

def print_tree
  puts "    Table: #{name}"
  puts "      ShortName: #{ table_fragment["ShortName"] }"
  puts "      LongName: #{ table_fragment["LongName"] }"
  puts "      StandardName: #{ table_fragment["StandardName"] }"
  puts "      Units: #{ table_fragment["Units"] }"
  puts "      Searchable: #{ table_fragment["Searchable"] }"
end

#resolve(value) ⇒ Object



36
37
38
# File 'lib/rets/metadata/table.rb', line 36

def resolve(value)
  value.to_s.strip
end