Class: Raf::Table

Inherits:
Element show all
Defined in:
lib/rafelement.rb

Instance Attribute Summary

Attributes inherited from Element

#contents

Instance Method Summary collapse

Methods inherited from Element

#add=, #initialize

Constructor Details

This class inherits a constructor from Raf::Element

Instance Method Details

#applyObject



127
128
129
130
131
132
133
134
135
136
137
138
139
140
# File 'lib/rafelement.rb', line 127

def apply
  str = ""
  @contents.each do |line|
    line.each do |item|
      if item.split(//)[0] == "*"
        str += "|*#{item.sub(/^\*/, "").sub(/\*$/,"")}"
      else
        str += "|#{item}"
      end
    end
    str += "\n"
  end
  str
end