Module: ExportHelper
- Included in:
- Export
- Defined in:
- lib/helpers/export_helpert.rb
Instance Method Summary collapse
- #convert_headers(fields, headers) ⇒ Object
- #get_fields(instance) ⇒ Object
- #sequences_headers(sequence, fields) ⇒ Object
Instance Method Details
#convert_headers(fields, headers) ⇒ Object
9 10 11 12 13 14 |
# File 'lib/helpers/export_helpert.rb', line 9 def convert_headers(fields, headers) fields.map{ |field| field.sub!('_', ' ').split(' ').map(&:capitalize).join(' ') } headers.each do |initial, new| end end |
#get_fields(instance) ⇒ Object
3 4 5 6 7 |
# File 'lib/helpers/export_helpert.rb', line 3 def get_fields instance instance = instance.attributes if instance.class != 'Hash' internal_headers = instance.keys internal_headers end |
#sequences_headers(sequence, fields) ⇒ Object
16 17 18 19 20 |
# File 'lib/helpers/export_helpert.rb', line 16 def sequences_headers(sequence, fields) keys = sequence keys << fields - sequence keys.flatten end |