Class: Rhubarb::Column

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, kind, quals) ⇒ Column

Returns a new instance of Column.



69
70
71
72
73
# File 'lib/rhubarb/rhubarb.rb', line 69

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.



67
68
69
# File 'lib/rhubarb/rhubarb.rb', line 67

def name
  @name
end

Instance Method Details

#to_sObject



75
76
77
78
79
80
81
82
# File 'lib/rhubarb/rhubarb.rb', line 75

def to_s
  qualifiers = @quals.join(" ")
  if qualifiers == ""
    "#@name #@kind"
  else
    "#@name #@kind #{qualifiers}"
  end
end