Class: RBHive::TableSchema::Column
- Inherits:
-
Object
- Object
- RBHive::TableSchema::Column
- Defined in:
- lib/rbhive/table_schema.rb
Instance Attribute Summary collapse
-
#comment ⇒ Object
readonly
Returns the value of attribute comment.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(name, type, comment = nil) ⇒ Column
constructor
A new instance of Column.
- #to_s ⇒ Object
Constructor Details
#initialize(name, type, comment = nil) ⇒ Column
Returns a new instance of Column.
78 79 80 |
# File 'lib/rbhive/table_schema.rb', line 78 def initialize(name, type, comment=nil) @name, @type, @comment = name, type, comment end |
Instance Attribute Details
#comment ⇒ Object (readonly)
Returns the value of attribute comment.
77 78 79 |
# File 'lib/rbhive/table_schema.rb', line 77 def comment @comment end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
77 78 79 |
# File 'lib/rbhive/table_schema.rb', line 77 def name @name end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
77 78 79 |
# File 'lib/rbhive/table_schema.rb', line 77 def type @type end |
Instance Method Details
#to_s ⇒ Object
82 83 84 85 |
# File 'lib/rbhive/table_schema.rb', line 82 def to_s comment_string = @comment.nil? ? '' : " COMMENT '#{@comment}'" "`#{@name}` #{@type.to_s.upcase}#{comment_string}" end |