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.



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

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

Instance Attribute Details

#long_nameObject

Returns the value of attribute long_name.



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

def long_name
  @long_name
end

#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.



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

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



29
30
31
32
33
34
35
36
37
# File 'lib/rets/metadata/table.rb', line 29

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"] }"
  puts "      Required: #{table_fragment['Required']}"
end

#resolve(value) ⇒ Object



39
40
41
# File 'lib/rets/metadata/table.rb', line 39

def resolve(value)
  value.to_s.strip
end