Class: EmlToPdf::Configuration
- Inherits:
-
Object
- Object
- EmlToPdf::Configuration
- Defined in:
- lib/eml_to_pdf/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 |
# 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_label ⇒ Object
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_label ⇒ Object
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_label ⇒ Object
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 |
#link_format_whitelist ⇒ Object
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 |
#links_enabled ⇒ Object
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_visible ⇒ Object
Returns the value of attribute metadata_visible.
3 4 5 |
# File 'lib/eml_to_pdf/configuration.rb', line 3 def @metadata_visible end |
#to_label ⇒ Object
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 |