Class: SVGProfiler
- Inherits:
-
Object
show all
- Defined in:
- lib/svg_profiler/base.rb
Defined Under Namespace
Classes: Histogram, Inkscape
Instance Method Summary
collapse
Constructor Details
#initialize(xml_string) ⇒ SVGProfiler
Returns a new instance of SVGProfiler.
3
4
5
6
|
# File 'lib/svg_profiler/base.rb', line 3
def initialize(xml_string)
@xml_string = xml_string
@inkscape = Inkscape.new(xml_string)
end
|
Instance Method Details
#aspect ⇒ Object
20
21
22
|
# File 'lib/svg_profiler/base.rb', line 20
def aspect
width.to_f / height
end
|
#dimensions ⇒ Object
16
17
18
|
# File 'lib/svg_profiler/base.rb', line 16
def dimensions
[width, height]
end
|
#height ⇒ Object
12
13
14
|
# File 'lib/svg_profiler/base.rb', line 12
def height
@inkscape.height
end
|
#histogram ⇒ Object
24
25
26
|
# File 'lib/svg_profiler/base.rb', line 24
def histogram
@inkscape.yield_png { |png| Histogram.for(@xml_string, png) }
end
|
#width ⇒ Object
8
9
10
|
# File 'lib/svg_profiler/base.rb', line 8
def width
@inkscape.width
end
|