Class: Gobstones::Lang::Sur
Constant Summary
Constants inherited
from Literal
Literal::OPERATORS_MAPPING
Instance Method Summary
collapse
Methods inherited from Direction
#<, all, order, #return_type
Methods inherited from Literal
#<, #<=>, #==, #evaluate, #if_false, #if_true, #not, #return_type, #same_type_as, #true?
Methods inherited from Expression
#evaluate, #is_function_call?
#==, #equality_attributes
Instance Method Details
#can_move?(head) ⇒ Boolean
76
77
78
|
# File 'lib/gobstones/lang/literals/direction.rb', line 76
def can_move?(head)
head.can_move_south?
end
|
#move(head) ⇒ Object
80
81
82
|
# File 'lib/gobstones/lang/literals/direction.rb', line 80
def move(head)
head.move_south
end
|
#next ⇒ Object
92
93
94
|
# File 'lib/gobstones/lang/literals/direction.rb', line 92
def next
Oeste.new
end
|
#opposite ⇒ Object
84
85
86
|
# File 'lib/gobstones/lang/literals/direction.rb', line 84
def opposite
Norte.new
end
|
#previous ⇒ Object
88
89
90
|
# File 'lib/gobstones/lang/literals/direction.rb', line 88
def previous
Este.new
end
|
#to_s ⇒ Object
96
97
98
|
# File 'lib/gobstones/lang/literals/direction.rb', line 96
def to_s
'Sur'
end
|