Class: EPIC::TXT

Inherits:
Rackful::Serializer show all
Defined in:
src/epic_collection.rb

Constant Summary

CONTENT_TYPES =
[
  'text/plain; charset=US-ASCII',
  'text/csv; charset=US-ASCII',
]

Instance Attribute Summary

Attributes inherited from Rackful::Serializer

#content_type, #resource

Instance Method Summary (collapse)

Constructor Details

- (TXT) initialize(*args)

A new instance of TXT



27
28
29
30
31
# File 'src/epic_collection.rb', line 27

def initialize *args
  super(*args)
  @newline = ( 'text/csv; charset=US-ASCII' == self.content_type ) ?
    "\r\n" : "\n"
end

Instance Method Details

- (void) each



32
33
34
35
36
37
# File 'src/epic_collection.rb', line 32

def each
  self.resource.each do
    |path|
    yield path.to_s + @newline
  end
end