Class: Gobstones::Lang::Norte
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
24
25
26
|
# File 'lib/gobstones/lang/literals/direction.rb', line 24
def can_move?(head)
head.can_move_north?
end
|
#move(head) ⇒ Object
28
29
30
|
# File 'lib/gobstones/lang/literals/direction.rb', line 28
def move(head)
head.move_north
end
|
#next ⇒ Object
40
41
42
|
# File 'lib/gobstones/lang/literals/direction.rb', line 40
def next
Este.new
end
|
#opposite ⇒ Object
32
33
34
|
# File 'lib/gobstones/lang/literals/direction.rb', line 32
def opposite
Sur.new
end
|
#previous ⇒ Object
36
37
38
|
# File 'lib/gobstones/lang/literals/direction.rb', line 36
def previous
Oeste.new
end
|
#to_s ⇒ Object
44
45
46
|
# File 'lib/gobstones/lang/literals/direction.rb', line 44
def to_s
'Norte'
end
|