Class: MonoclePrint::Pair
- Inherits:
-
Struct
- Object
- Struct
- MonoclePrint::Pair
- Defined in:
- lib/monocle-print/geometry.rb,
lib/monocle-print/geometry.rb
Instance Attribute Summary collapse
-
#x ⇒ Object
Returns the value of attribute x.
-
#y ⇒ Object
Returns the value of attribute y.
Instance Method Summary collapse
- #+(n) ⇒ Object
- #+@ ⇒ Object
- #-(n) ⇒ Object
- #-@ ⇒ Object
-
#initialize(x = 0, y = 0) ⇒ Pair
constructor
A new instance of Pair.
- #~ ⇒ Object
Constructor Details
#initialize(x = 0, y = 0) ⇒ Pair
Returns a new instance of Pair.
20 21 22 |
# File 'lib/monocle-print/geometry.rb', line 20 def initialize( x = 0, y = 0 ) super end |
Instance Attribute Details
#x ⇒ Object
Returns the value of attribute x
5 6 7 |
# File 'lib/monocle-print/geometry.rb', line 5 def x @x end |
#y ⇒ Object
Returns the value of attribute y
5 6 7 |
# File 'lib/monocle-print/geometry.rb', line 5 def y @y end |
Instance Method Details
#+(n) ⇒ Object
41 42 43 44 |
# File 'lib/monocle-print/geometry.rb', line 41 def +( n ) self.column += n self end |
#+@ ⇒ Object
24 25 26 27 28 |
# File 'lib/monocle-print/geometry.rb', line 24 def +@ self.column = 0 self.line += 1 self end |
#-(n) ⇒ Object
46 47 48 49 |
# File 'lib/monocle-print/geometry.rb', line 46 def -( n ) self.column -= n self end |
#-@ ⇒ Object
35 36 37 38 39 |
# File 'lib/monocle-print/geometry.rb', line 35 def -@ self.column = 0 self.line -= 1 self end |
#~ ⇒ Object
30 31 32 33 |
# File 'lib/monocle-print/geometry.rb', line 30 def ~ self.column = 0 self end |