Module: LazyImageTag::HelperGenerator

Included in:
Engine
Defined in:
lib/lazy_image_tag/helper_generator.rb

Instance Method Summary collapse

Instance Method Details

#injectObject



15
16
17
# File 'lib/lazy_image_tag/helper_generator.rb', line 15

def inject
  ActionView::Base.class_eval{ alias_method :lazy_image_tag, :image_tag_with_lazy; alias_method :image_tag_without_lazy, :image_tag }
end

#inject_helperObject



6
7
8
9
# File 'lib/lazy_image_tag/helper_generator.rb', line 6

def inject_helper
  ActionView::Base.send :include, ImageHelper
  config.lazy_image_tag.use_default ? override : inject
end

#overrideObject



11
12
13
# File 'lib/lazy_image_tag/helper_generator.rb', line 11

def override
  ActionView::Base.class_eval{ alias_method_chain :image_tag, :lazy }
end