Class: FastImage::Svg

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

Overview

:nodoc:

Instance Method Summary collapse

Constructor Details

#initialize(stream) ⇒ Svg



651
652
653
654
# File 'lib/fastimage.rb', line 651

def initialize(stream)
  @stream = stream
  parse_svg
end

Instance Method Details

#width_and_heightObject



656
657
658
659
660
661
662
663
664
# File 'lib/fastimage.rb', line 656

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