Class: MonoclePrint::Rectangle
- Inherits:
-
Struct
- Object
- Struct
- MonoclePrint::Rectangle
- Defined in:
- lib/monocle-print/geometry.rb,
lib/monocle-print/geometry.rb
Instance Attribute Summary collapse
-
#bottom ⇒ Object
Returns the value of attribute bottom.
-
#left ⇒ Object
Returns the value of attribute left.
-
#right ⇒ Object
Returns the value of attribute right.
-
#top ⇒ Object
Returns the value of attribute top.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(left = 0, top = left, right = left, bottom = top) ⇒ Rectangle
constructor
A new instance of Rectangle.
Constructor Details
#initialize(left = 0, top = left, right = left, bottom = top) ⇒ Rectangle
Returns a new instance of Rectangle.
62 63 64 |
# File 'lib/monocle-print/geometry.rb', line 62 def initialize( left = 0, top = left, right = left, bottom = top ) super( left, top, right, bottom ) end |
Instance Attribute Details
#bottom ⇒ Object
Returns the value of attribute bottom
52 53 54 |
# File 'lib/monocle-print/geometry.rb', line 52 def bottom @bottom end |
#left ⇒ Object
Returns the value of attribute left
52 53 54 |
# File 'lib/monocle-print/geometry.rb', line 52 def left @left end |
#right ⇒ Object
Returns the value of attribute right
52 53 54 |
# File 'lib/monocle-print/geometry.rb', line 52 def right @right end |
#top ⇒ Object
Returns the value of attribute top
52 53 54 |
# File 'lib/monocle-print/geometry.rb', line 52 def top @top end |
Class Method Details
.create(params) ⇒ Object
54 55 56 57 58 59 60 |
# File 'lib/monocle-print/geometry.rb', line 54 def self.create( params ) left = params.fetch( :left, 0 ) right = params.fetch( :right, left ) top = params.fetch( :top, left ) bottom = params.fetch( :bottom, top ) new( left, top, right, bottom ) end |