class Dieses::Application::Paper::Instance
Attributes
margin[R]
Public Class Methods
new(width, height, **margin)
click to toggle source
Calls superclass method
# File lib/dieses/application/paper.rb, line 97 def initialize(width, height, **margin) @margin = Margin.new(**margin) super(Geometry::Rect.new(width, height)) end
Public Instance Methods
inner()
click to toggle source
# File lib/dieses/application/paper.rb, line 102 def inner @inner ||= shrink(width: left + right, height: top + bottom) end
orient(orientation)
click to toggle source
Calls superclass method
# File lib/dieses/application/paper.rb, line 106 def orient(orientation) self.class.new((rect = super).width, rect.height, **margin.to_h) end
to_h()
click to toggle source
Calls superclass method
# File lib/dieses/application/paper.rb, line 110 def to_h super.merge(margin.to_h) end