Class: Muddle::Configuration
- Inherits:
-
Object
- Object
- Muddle::Configuration
- Defined in:
- lib/muddle/configuration.rb
Instance Attribute Summary collapse
-
#generate_plain_text ⇒ Object
Returns the value of attribute generate_plain_text.
-
#insert_boilerplate_attributes ⇒ Object
Returns the value of attribute insert_boilerplate_attributes.
-
#insert_boilerplate_css ⇒ Object
Returns the value of attribute insert_boilerplate_css.
-
#insert_boilerplate_styles ⇒ Object
Returns the value of attribute insert_boilerplate_styles.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#parse_with_premailer ⇒ Object
Returns the value of attribute parse_with_premailer.
-
#premailer_options ⇒ Object
Returns the value of attribute premailer_options.
-
#validate_html ⇒ Object
Returns the value of attribute validate_html.
Instance Method Summary collapse
-
#configure {|_self| ... } ⇒ Object
Set config vars.
-
#initialize(options = {}) ⇒ Configuration
constructor
Initialize the configuration object with default values.
Constructor Details
#initialize(options = {}) ⇒ Configuration
Initialize the configuration object with default values
if a block is passed, we’ll yield ‘this’ to it so you can set config values
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/muddle/configuration.rb', line 16 def initialize( = {}) @parse_with_premailer = [:parse_with_premailer] || true @insert_boilerplate_styles = [:insert_boilerplate_styles] || true @insert_boilerplate_css = [:insert_boilerplate_css] || true @insert_boilerplate_attributes = [:insert_boilerplate_attributes] || true @validate_html = [:validate_html] || true @generate_plain_text = [:generate_plain_text] || false @logger = [:logger] # NOTE: when this tries to inline CSS, all it sees is a stylesheet URL # This may require that we download css from the interwebs @ each render # pass of a mailer ?!?!? @premailer_options = { :remove_comments => true, # Env-dependent? :with_html_string => true, :adapter => :hpricot } end |
Instance Attribute Details
#generate_plain_text ⇒ Object
Returns the value of attribute generate_plain_text.
7 8 9 |
# File 'lib/muddle/configuration.rb', line 7 def generate_plain_text @generate_plain_text end |
#insert_boilerplate_attributes ⇒ Object
Returns the value of attribute insert_boilerplate_attributes.
5 6 7 |
# File 'lib/muddle/configuration.rb', line 5 def insert_boilerplate_attributes @insert_boilerplate_attributes end |
#insert_boilerplate_css ⇒ Object
Returns the value of attribute insert_boilerplate_css.
4 5 6 |
# File 'lib/muddle/configuration.rb', line 4 def insert_boilerplate_css @insert_boilerplate_css end |
#insert_boilerplate_styles ⇒ Object
Returns the value of attribute insert_boilerplate_styles.
3 4 5 |
# File 'lib/muddle/configuration.rb', line 3 def insert_boilerplate_styles @insert_boilerplate_styles end |
#logger ⇒ Object
Returns the value of attribute logger.
8 9 10 |
# File 'lib/muddle/configuration.rb', line 8 def logger @logger end |
#parse_with_premailer ⇒ Object
Returns the value of attribute parse_with_premailer.
2 3 4 |
# File 'lib/muddle/configuration.rb', line 2 def parse_with_premailer @parse_with_premailer end |
#premailer_options ⇒ Object
Returns the value of attribute premailer_options.
10 11 12 |
# File 'lib/muddle/configuration.rb', line 10 def @premailer_options end |
#validate_html ⇒ Object
Returns the value of attribute validate_html.
6 7 8 |
# File 'lib/muddle/configuration.rb', line 6 def validate_html @validate_html end |
Instance Method Details
#configure {|_self| ... } ⇒ Object
Set config vars
Pass it a block, will yield the config object
39 40 41 42 |
# File 'lib/muddle/configuration.rb', line 39 def configure yield self self end |