Module: BuzzImage

Defined in:
lib/buzz_image.rb,
lib/buzz_image/version.rb,
lib/buzz_image/configuration.rb,
lib/buzz_image/buzz_image_helper.rb

Defined Under Namespace

Classes: Configuration

Constant Summary collapse

VERSION =
"0.0.1"

Instance Method Summary collapse

Instance Method Details

#buzz_image_tag(*args, &block) ⇒ Object



2
3
4
5
6
# File 'lib/buzz_image/buzz_image_helper.rb', line 2

def buzz_image_tag(*args, &block)
  options = insert_buzz_class(args.extract_options!)
  args << options
  image_tag(*args, &block)
end

#insert_buzz_class(options) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/buzz_image/buzz_image_helper.rb', line 8

def insert_buzz_class(options)
  class_name = 'buzz_image'
  if options.key?(:class)
    options[:class] += " #{class_name}"
  elsif options.key?('class')
    options['class'] += " #{class_name}"
  else
    options[:class] = class_name
  end
  options
end