Class: MakeExportable::ExportableFormat

Inherits:
Object
  • Object
show all
Defined in:
lib/make_exportable/exportable_format.rb

Overview

:nodoc:

Direct Known Subclasses

CSV, Excel, HTML, JSON, TSV, XML

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#longObject

Returns the value of attribute long.



7
8
9
# File 'lib/make_exportable/exportable_format.rb', line 7

def long
  @long
end

#mime_typeObject

Returns the value of attribute mime_type.



8
9
10
# File 'lib/make_exportable/exportable_format.rb', line 8

def mime_type
  @mime_type
end

Class Method Details

.register_formatObject

Register this format with the mothership



12
13
14
15
16
# File 'lib/make_exportable/exportable_format.rb', line 12

def register_format
  unless MakeExportable.exportable_formats[self.reference]
    MakeExportable.exportable_formats[self.reference] = self
  end
end

Instance Method Details

#generate(data_set, data_headers = nil) ⇒ Object



20
21
# File 'lib/make_exportable/exportable_format.rb', line 20

def generate(data_set, data_headers=nil)
end

#generate_header_option(data_headers = []) ⇒ Object



27
28
29
# File 'lib/make_exportable/exportable_format.rb', line 27

def generate_header_option(data_headers=[])
  self.mime_type += (self.data_headers.blank? || data_headers === false) ? " header=absent" : " header=present"
end

#sanitize(value) ⇒ Object



23
24
25
# File 'lib/make_exportable/exportable_format.rb', line 23

def sanitize(value)
  value
end