Class: Dieses::Application::Paper::Instance
- Inherits:
-
Geometry::Rect
- Object
- Geometry::Element
- Geometry::Rect
- Dieses::Application::Paper::Instance
- Extended by:
- Support::ClassAttribute, Forwardable
- Defined in:
- lib/dieses/application/paper.rb
Constant Summary
Constants inherited from Geometry::Rect
Instance Attribute Summary
Attributes inherited from Geometry::Rect
Attributes inherited from Geometry::Element
Instance Method Summary collapse
-
#initialize(width, height, **margin) ⇒ Instance
constructor
A new instance of Instance.
- #inner ⇒ Object
- #orient(orientation) ⇒ Object
- #to_h ⇒ Object
Methods included from Support::ClassAttribute
Methods inherited from Geometry::Rect
#align, #angle, #bbox, #intersect, #orientation, #shrink, #to_s, #to_svgf, #translate
Methods included from Geometry::Rect::Predicate
#cover?, #inside?, #onto?, #outside?
Methods inherited from Geometry::Element
#attr, #classify, #eql?, #to_svg
Constructor Details
Instance Method Details
#inner ⇒ Object
102 103 104 |
# File 'lib/dieses/application/paper.rb', line 102 def inner @inner ||= shrink(width: left + right, height: top + bottom) end |
#orient(orientation) ⇒ Object
106 107 108 |
# 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 ⇒ Object
110 111 112 |
# File 'lib/dieses/application/paper.rb', line 110 def to_h super.merge(margin.to_h) end |