Class: Lazyload::Rails::Configuration
- Inherits:
-
Object
- Object
- Lazyload::Rails::Configuration
- Defined in:
- lib/lazyload-rails/config.rb
Overview
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
Set default settings.
- #lazy_by_default ⇒ Object
-
#lazy_by_default=(lazy_by_default) ⇒ Object
When set to true every image_tag will include { lazy: true } by default.
-
#placeholder ⇒ Object
The placeholder image to put into the img src attribute (default: 1×1 pixel grey gif at “”).
- #placeholder=(new_placeholder) ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Set default settings
32 33 34 35 |
# File 'lib/lazyload-rails/config.rb', line 32 def initialize @placeholder = "data:image/gif;base64,R0lGODdhAQABAPAAAMPDwwAAACwAAAAAAQABAAACAkQBADs=" @lazy_by_default = false end |
Instance Method Details
#lazy_by_default ⇒ Object
27 28 29 |
# File 'lib/lazyload-rails/config.rb', line 27 def lazy_by_default @lazy_by_default end |
#lazy_by_default=(lazy_by_default) ⇒ Object
When set to true every image_tag will include { lazy: true } by default
24 25 26 |
# File 'lib/lazyload-rails/config.rb', line 24 def lazy_by_default=(lazy_by_default) @lazy_by_default = !!lazy_by_default end |
#placeholder ⇒ Object
The placeholder image to put into the img src attribute (default: 1×1 pixel grey gif at “”).
16 17 18 |
# File 'lib/lazyload-rails/config.rb', line 16 def placeholder @placeholder end |
#placeholder=(new_placeholder) ⇒ Object
19 20 21 |
# File 'lib/lazyload-rails/config.rb', line 19 def placeholder=(new_placeholder) @placeholder = new_placeholder end |