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

Inherits:
Base show all
Defined in:
lib/athena/formats/lingo.rb

Overview

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

Class Method Summary collapse

Methods inherited from Base

deferred?

Methods inherited from Athena::Formats

[], deferred?, formats, #parse, valid_format?

Class Method Details

.convert(record) ⇒ Object



108
109
110
111
112
113
114
115
116
117
118
# File 'lib/athena/formats/lingo.rb', line 108

def self.convert(record)
  super.map { |terms|
    next unless check_number_of_arguments('odd, > 1', terms.size) { |actual|
      actual > 1 && actual % 2 == 1
    }

    [terms.shift, terms.to_enum(:each_slice, 2).map { |form, wc|
      "#{form} ##{wc}"
    }.join(' ')].join(',')
  }.compact
end