Class: EmlToPdfExt::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/eml_to_pdf_ext/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



5
6
7
8
9
10
11
12
13
14
# File 'lib/eml_to_pdf_ext/configuration.rb', line 5

def initialize
  @from_label = 'From'
  @to_label = 'To'
  @cc_label = 'Cc'
  @date_label = 'Date'
  @date_format = lambda { |date| date.strftime('%Y-%m-%d %H:%M:%S %z') }
   = true
  @links_enabled = true
  @link_format_whitelist = []
end

Instance Attribute Details

#cc_labelObject

Returns the value of attribute cc_label.



3
4
5
# File 'lib/eml_to_pdf_ext/configuration.rb', line 3

def cc_label
  @cc_label
end

#date_labelObject

Returns the value of attribute date_label.



3
4
5
# File 'lib/eml_to_pdf_ext/configuration.rb', line 3

def date_label
  @date_label
end

#from_labelObject

Returns the value of attribute from_label.



3
4
5
# File 'lib/eml_to_pdf_ext/configuration.rb', line 3

def from_label
  @from_label
end

Returns the value of attribute link_format_whitelist.



3
4
5
# File 'lib/eml_to_pdf_ext/configuration.rb', line 3

def link_format_whitelist
  @link_format_whitelist
end

Returns the value of attribute links_enabled.



3
4
5
# File 'lib/eml_to_pdf_ext/configuration.rb', line 3

def links_enabled
  @links_enabled
end

#metadata_visibleObject

Returns the value of attribute metadata_visible.



3
4
5
# File 'lib/eml_to_pdf_ext/configuration.rb', line 3

def 
  
end

#to_labelObject

Returns the value of attribute to_label.



3
4
5
# File 'lib/eml_to_pdf_ext/configuration.rb', line 3

def to_label
  @to_label
end

Instance Method Details

#date_format(&block) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/eml_to_pdf_ext/configuration.rb', line 16

def date_format(&block)
  if block_given?
    @date_format = block
  else
    @date_format
  end
end

#format_date(date) ⇒ Object



24
25
26
# File 'lib/eml_to_pdf_ext/configuration.rb', line 24

def format_date(date)
  @date_format.call(date)
end