Class: EmlToPdfExt::Configuration
- Inherits:
-
Object
- Object
- EmlToPdfExt::Configuration
- Defined in:
- lib/eml_to_pdf_ext/configuration.rb
Instance Attribute Summary collapse
-
#cc_label ⇒ Object
Returns the value of attribute cc_label.
-
#date_label ⇒ Object
Returns the value of attribute date_label.
-
#from_label ⇒ Object
Returns the value of attribute from_label.
-
#link_format_whitelist ⇒ Object
Returns the value of attribute link_format_whitelist.
-
#links_enabled ⇒ Object
Returns the value of attribute links_enabled.
-
#metadata_visible ⇒ Object
Returns the value of attribute metadata_visible.
-
#to_label ⇒ Object
Returns the value of attribute to_label.
Instance Method Summary collapse
- #date_format(&block) ⇒ Object
- #format_date(date) ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
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_label ⇒ Object
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_label ⇒ Object
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_label ⇒ Object
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 |
#link_format_whitelist ⇒ Object
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 |
#links_enabled ⇒ Object
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_visible ⇒ Object
Returns the value of attribute metadata_visible.
3 4 5 |
# File 'lib/eml_to_pdf_ext/configuration.rb', line 3 def end |
#to_label ⇒ Object
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 |