Class: Inkmake::InkscapeResolution
- Inherits:
-
Object
- Object
- Inkmake::InkscapeResolution
- Defined in:
- lib/inkmake.rb
Instance Attribute Summary collapse
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Instance Method Summary collapse
-
#initialize(width, height, unit = "uu") ⇒ InkscapeResolution
constructor
A new instance of InkscapeResolution.
- #scale(f) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(width, height, unit = "uu") ⇒ InkscapeResolution
Returns a new instance of InkscapeResolution.
101 102 103 104 |
# File 'lib/inkmake.rb', line 101 def initialize(width, height, unit="uu") @width = width.kind_of?(InkscapeUnit) ? width : InkscapeUnit.new(width, unit) @height = height.kind_of?(InkscapeUnit) ? height : InkscapeUnit.new(height, unit) end |
Instance Attribute Details
#height ⇒ Object (readonly)
Returns the value of attribute height.
99 100 101 |
# File 'lib/inkmake.rb', line 99 def height @height end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
99 100 101 |
# File 'lib/inkmake.rb', line 99 def width @width end |
Instance Method Details
#scale(f) ⇒ Object
106 107 108 |
# File 'lib/inkmake.rb', line 106 def scale(f) InkscapeResolution.new(@width.scale(f), @height.scale(f)) end |
#to_s ⇒ Object
110 111 112 |
# File 'lib/inkmake.rb', line 110 def to_s "#{@width.to_s}x#{@height.to_s}" end |