Class: DragonflySvg::Analysers::HeightAnalyser

Inherits:
Base
  • Object
show all
Defined in:
lib/dragonfly_svg/analysers/height_analyser.rb

Instance Method Summary collapse

Methods inherited from Base

#is_svg?

Constructor Details

#initialize(app) ⇒ HeightAnalyser

Returns a new instance of HeightAnalyser.



4
5
6
7
8
9
10
11
12
13
# File 'lib/dragonfly_svg/analysers/height_analyser.rb', line 4

def initialize(app)
  original = app.analysers.items[:height]
  app.add_analyser(:height) do |content|
    if is_svg?(content)
      content.analyse(:svg_properties)[:height]
    elsif original
      original.call(content)
    end
  end
end