Module: Listings::ApplicationHelper

Defined in:
app/helpers/listings/application_helper.rb

Instance Method Summary collapse

Instance Method Details

#excel_type(value) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'app/helpers/listings/application_helper.rb', line 3

def excel_type(value)
  if value.is_a?(Fixnum) || value.is_a?(Float)
    "Number"
  elsif !!value == value
    "Boolean"
  else
    "String"
  end
end

#excel_value(value) ⇒ Object



13
14
15
16
17
18
19
# File 'app/helpers/listings/application_helper.rb', line 13

def excel_value(value)
  if !!value == value
    value ? 1 : 0
  else
    value
  end
end