Class: RDGC::Map::Direction
- Inherits:
-
Object
- Object
- RDGC::Map::Direction
- Defined in:
- lib/rdgc/map/direction.rb
Constant Summary collapse
- SELF =
self.create(0, 0)
- LEFT =
self.create(-1, 0)
- RIGHT =
self.create(1, 0)
- UPPER =
self.create(0, -1)
- BOTTOM =
self.create(0, 1)
Instance Attribute Summary collapse
-
#x ⇒ Object
readonly
Returns the value of attribute x.
-
#y ⇒ Object
readonly
Returns the value of attribute y.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#x ⇒ Object (readonly)
Returns the value of attribute x.
6 7 8 |
# File 'lib/rdgc/map/direction.rb', line 6 def x @x end |
#y ⇒ Object (readonly)
Returns the value of attribute y.
6 7 8 |
# File 'lib/rdgc/map/direction.rb', line 6 def y @y end |
Class Method Details
.all ⇒ Object
37 38 39 |
# File 'lib/rdgc/map/direction.rb', line 37 def self.all [LEFT, UPPER, RIGHT, BOTTOM] end |
.each ⇒ Object
30 31 32 33 34 35 |
# File 'lib/rdgc/map/direction.rb', line 30 def self.each return to_enum(:each) unless block_given? self.all.each do |d| yield(d) end end |