Module: Premailer::Rails::CSSHelper
Constant Summary collapse
- FileNotFound =
Class.new(StandardError)
Instance Attribute Summary collapse
-
#cache ⇒ Object
Returns the value of attribute cache.
Instance Method Summary collapse
-
#css_for_doc(doc) ⇒ Object
Returns all linked CSS files concatenated as string.
- #css_for_url(url) ⇒ Object
Instance Attribute Details
#cache ⇒ Object
Returns the value of attribute cache.
8 9 10 |
# File 'lib/premailer/rails/css_helper.rb', line 8 def cache @cache end |
Instance Method Details
#css_for_doc(doc) ⇒ Object
Returns all linked CSS files concatenated as string.
12 13 14 |
# File 'lib/premailer/rails/css_helper.rb', line 12 def css_for_doc(doc) css_urls_in_doc(doc).map { |url| css_for_url(url) }.join("\n") end |
#css_for_url(url) ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/premailer/rails/css_helper.rb', line 16 def css_for_url(url) if cache_enabled? load_css_with_cache(url) else load_css(url) end end |