Class: GoogleFT::Table::Column
- Inherits:
-
Object
- Object
- GoogleFT::Table::Column
- Defined in:
- lib/google-ft/table/column.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(name, type = 'string') ⇒ Column
constructor
A new instance of Column.
Constructor Details
#initialize(name, type = 'string') ⇒ Column
Returns a new instance of Column.
6 7 8 9 10 11 12 13 |
# File 'lib/google-ft/table/column.rb', line 6 def initialize(name, type = 'string') # Cleanup the column name. self.name = name.gsub(/[^a-zA-Z0-9_\-]/, '_') # Store type and make sure it's valid. self.type = type.upcase raise ArgumentError unless ['STRING','NUMBER','DATETIME','LOCATION'].include?(self.type) end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/google-ft/table/column.rb', line 4 def name @name end |
#type ⇒ Object
Returns the value of attribute type.
4 5 6 |
# File 'lib/google-ft/table/column.rb', line 4 def type @type end |