Class: EmlToPdf::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/eml_to_pdf/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
# File 'lib/eml_to_pdf/configuration.rb', line 5

def initialize
  @from_label, @to_label, @cc_label, @date_label= 'From', 'To', 'Cc', 'Date'
  @date_format = lambda { |date| date.strftime('%Y-%m-%d %H:%M:%S %z') }
  @metadata_visible = 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/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/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/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/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/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/configuration.rb', line 3

def 
  @metadata_visible
end

#to_labelObject

Returns the value of attribute to_label.



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

def to_label
  @to_label
end

Instance Method Details

#date_format(&block) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/eml_to_pdf/configuration.rb', line 13

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

#format_date(date) ⇒ Object



21
22
23
# File 'lib/eml_to_pdf/configuration.rb', line 21

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