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.
112 113 114 |
# File 'lib/rbhive/table_schema.rb', line 112 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.
111 112 113 |
# File 'lib/rbhive/table_schema.rb', line 111 def comment @comment end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
111 112 113 |
# File 'lib/rbhive/table_schema.rb', line 111 def name @name end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
111 112 113 |
# File 'lib/rbhive/table_schema.rb', line 111 def type @type end |
Instance Method Details
#to_s ⇒ Object
116 117 118 119 |
# File 'lib/rbhive/table_schema.rb', line 116 def to_s comment_string = @comment.nil? ? '' : " COMMENT '#{@comment}'" "`#{@name}` #{@type.to_s.upcase}#{comment_string}" end |