Class: FastImage::Svg

Inherits:
Object
  • Object
show all
Defined in:
lib/fastimage.rb

Overview

:nodoc:

Instance Method Summary collapse

Constructor Details

#initialize(stream) ⇒ Svg

Returns a new instance of Svg.



617
618
619
620
# File 'lib/fastimage.rb', line 617

def initialize(stream)
  @stream = stream
  parse_svg
end

Instance Method Details

#width_and_heightObject



622
623
624
625
626
627
628
629
630
# File 'lib/fastimage.rb', line 622

def width_and_height
  if @width && @height
    [@width, @height]
  elsif @width && @ratio
    [@width, @width / @ratio]
  elsif @height && @ratio
    [@height * @ratio, @height]
  end
end