Class: Rhubarb::Column

Inherits:
Object
  • Object
show all
Defined in:
lib/rhubarb/column.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#nameObject (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_sObject



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