Class: Tilde
Constant Summary
collapse
- REP =
'~'
Instance Method Summary
collapse
Methods inherited from Op
#apply_monad_deep, #integer_args, #numeric_literal?, #to_numeric
Instance Method Details
#run(ary, interpreter) ⇒ Object
249
250
251
252
253
254
255
256
257
|
# File 'lib/jop.rb', line 249
def run ary, interpreter
if interpreter.tokens[0] == GradeUp::REP
interpreter.advance(1)
ary.sort
elsif interpreter.tokens[0] == GradeDown::REP
interpreter.advance(1)
ary.sort.reverse
end
end
|