Class: FastImage::Svg
- Inherits:
-
Object
- Object
- FastImage::Svg
- Defined in:
- lib/fastimage.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#initialize(stream) ⇒ Svg
constructor
A new instance of Svg.
- #width_and_height ⇒ Object
Constructor Details
#initialize(stream) ⇒ Svg
Returns a new instance of Svg.
525 526 527 528 |
# File 'lib/fastimage.rb', line 525 def initialize(stream) @stream = stream parse_svg end |
Instance Method Details
#width_and_height ⇒ Object
530 531 532 533 534 535 536 537 538 |
# File 'lib/fastimage.rb', line 530 def width_and_height if @width && @height [@width, @height] elsif @width && @ratio [@width, @width / @ratio] elsif @height && @ratio [@height * @ratio, @height] end end |