Class: Rhubarb::Column
- Inherits:
-
Object
- Object
- Rhubarb::Column
- Defined in:
- lib/rhubarb/column.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, kind, quals) ⇒ Column
constructor
A new instance of Column.
- #to_s ⇒ Object
Constructor Details
#initialize(name, kind, quals) ⇒ Column
Returns a new instance of Column.
17 18 19 20 21 |
# File 'lib/rhubarb/column.rb', line 17 def initialize(name, kind, quals) @name, @kind = name, kind @quals = quals.map {|x| x.to_s.gsub("_", " ") if x.class == Symbol} @quals.map end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
15 16 17 |
# File 'lib/rhubarb/column.rb', line 15 def name @name end |
Instance Method Details
#to_s ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/rhubarb/column.rb', line 23 def to_s qualifiers = @quals.join(" ") if qualifiers == "" "'#@name' #@kind" else "'#@name' #@kind #{qualifiers}" end end |