Class: Rets::Metadata::Table
- Inherits:
-
Object
- Object
- Rets::Metadata::Table
- Defined in:
- lib/rets/metadata/table.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#table_fragment ⇒ Object
Returns the value of attribute table_fragment.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(table_fragment) ⇒ Table
constructor
A new instance of Table.
- #print_tree ⇒ Object
- #resolve(value) ⇒ Object
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
#name ⇒ Object
Returns the value of attribute name.
18 19 20 |
# File 'lib/rets/metadata/table.rb', line 18 def name @name end |
#table_fragment ⇒ Object
Returns the value of attribute table_fragment.
19 20 21 |
# File 'lib/rets/metadata/table.rb', line 19 def table_fragment @table_fragment end |
#type ⇒ Object
Returns the value of attribute type.
17 18 19 |
# File 'lib/rets/metadata/table.rb', line 17 def type @type end |
Instance Method Details
#print_tree ⇒ Object
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 |