Class: Athena::Formats::Lingo::WordClass

Inherits:
Athena::Formats::Lingo show all
Defined in:
lib/athena/formats/lingo.rb

Overview

“Essen,essen #v Essen #s Esse #s”

Constant Summary collapse

SEPARATOR =
','

Constants inherited from Athena::Formats::Lingo

MultiKey

Instance Attribute Summary

Attributes inherited from Base

#config, #output, #record_element

Instance Method Summary collapse

Methods inherited from Athena::Formats::Lingo

#deferred?

Methods inherited from Base

#deferred?, directions, format, has_direction?, init, #init, #parse, #raw?, #run

Instance Method Details

#convert(record) ⇒ Object



65
66
67
68
69
70
71
72
73
# File 'lib/athena/formats/lingo.rb', line 65

def convert(record)
  super.map { |terms|
    [ terms.shift,
      terms.to_enum(:each_slice, 2).map { |w, c| "#{w} ##{c}" }.join(' ')
    ].join(SEPARATOR) if check_args('odd, > 1', terms.size) { |actual|
      actual > 1 && actual % 2 == 1
    }
  }.compact
end