Class: Rets::Metadata::Table
- Inherits:
-
Object
- Object
- Rets::Metadata::Table
- Defined in:
- lib/rets/metadata/table.rb
Instance Attribute Summary collapse
-
#long_name ⇒ Object
Returns the value of attribute long_name.
-
#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.
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_name ⇒ Object
Returns the value of attribute long_name.
19 20 21 |
# File 'lib/rets/metadata/table.rb', line 19 def long_name @long_name end |
#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.
20 21 22 |
# File 'lib/rets/metadata/table.rb', line 20 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
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 |