Method: CIAT::CiatFile#split
- Defined in:
- lib/ciat/ciat_file.rb
#split ⇒ Object
:nodoc:
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/ciat/ciat_file.rb', line 43 def split #:nodoc: tag = :description content = "" raw_elements = {} read.each do |line| if line =~ /^==== ((\w|\s)+?)\W*$/ raw_elements[tag] = content tag = $1.gsub(" ", "_").to_sym content = "" else content += line end end raw_elements[tag] = content raw_elements end |