Class: Twb::RowsColsSplitter

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
lib/twb/worksheet.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(node) ⇒ RowsColsSplitter

Returns a new instance of RowsColsSplitter.



156
157
158
159
160
161
162
163
# File 'lib/twb/worksheet.rb', line 156

def initialize node
  @fields = []
  return fields if node.nil?
  unless node.text.nil?
    codes = node.text.split(/[\])] [\/+*] [(]?\[/)
    codes.each {|c| @fields << c.gsub(/^[(]*[\[]*|[)\]]*$/,'')}
  end
end

Instance Attribute Details

#fieldsObject (readonly)

Returns the value of attribute fields.



155
156
157
# File 'lib/twb/worksheet.rb', line 155

def fields
  @fields
end