Class: Athena::Formats::Lingo::Base

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

Direct Known Subclasses

KeyValue, MultiValue, SingleWord, WordClass

Class Method Summary collapse

Methods inherited from Athena::Formats

[], formats, #parse, valid_format?

Class Method Details

.convert(record) ⇒ Object



40
41
42
43
44
45
46
47
48
# File 'lib/athena/formats/lingo.rb', line 40

def convert(record)
  record.struct.inject([]) { |terms, (field, struct)|
    terms << struct[:elements].inject([]) { |array, element|
      array += (struct[:values][element] || []).map { |v|
        (v || '').strip.gsub(/(?:\r?\n)+/, ' ')
      }.reject { |v| v.empty? }
    }
  }
end

.deferred?Boolean

Returns:

  • (Boolean)


50
51
52
# File 'lib/athena/formats/lingo.rb', line 50

def deferred?
  true
end