Class: Gobstones::Lang::Este
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
50
51
52
|
# File 'lib/gobstones/lang/literals/direction.rb', line 50
def can_move?(head)
head.can_move_east?
end
|
#move(head) ⇒ Object
54
55
56
|
# File 'lib/gobstones/lang/literals/direction.rb', line 54
def move(head)
head.move_east
end
|
#next ⇒ Object
66
67
68
|
# File 'lib/gobstones/lang/literals/direction.rb', line 66
def next
Sur.new
end
|
#opposite ⇒ Object
58
59
60
|
# File 'lib/gobstones/lang/literals/direction.rb', line 58
def opposite
Oeste.new
end
|
#previous ⇒ Object
62
63
64
|
# File 'lib/gobstones/lang/literals/direction.rb', line 62
def previous
Norte.new
end
|
#to_s ⇒ Object
70
71
72
|
# File 'lib/gobstones/lang/literals/direction.rb', line 70
def to_s
'Este'
end
|