Class: Grammar::Ruby::Code::Not

Inherits:
Unary show all
Defined in:
lib/grammar/ruby/code.rb

Constant Summary

Constants inherited from Grammar::Ruby::Code

False, FalseTerminator, Implicit, Nil, Self, True

Instance Method Summary collapse

Methods inherited from Unary

#_codes, #_lines

Methods inherited from Grammar::Ruby::Code

[], #_and, #_assign, #_classname, #_code_self, #_codes, #_def, #_dot, #_else, #_ensure, #_equal, #_immediate, #_inspect, #_lines, #_locals, #_or, #_question, #_rand, #_rcond, #_rescue, #_ror, #_rstep, #_splat, #_to_block, #_unless, #_until, #_while, #method_missing

Constructor Details

#initialize(operand) ⇒ Not

Returns a new instance of Not.



391
392
393
# File 'lib/grammar/ruby/code.rb', line 391

def initialize(operand)
    @operand = operand
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Grammar::Ruby::Code

Instance Method Details

#_alwaysObject



400
401
402
# File 'lib/grammar/ruby/code.rb', line 400

def _always
    @operand._never
end

#_dataObject



394
395
396
# File 'lib/grammar/ruby/code.rb', line 394

def _data
    nil
end

#_mid(before) ⇒ Object



409
410
411
# File 'lib/grammar/ruby/code.rb', line 409

def _mid(before)
    @operand._mid(before)
end

#_neverObject



403
404
405
# File 'lib/grammar/ruby/code.rb', line 403

def _never
    @operand._always
end

#_notObject



406
407
408
# File 'lib/grammar/ruby/code.rb', line 406

def _not
    @operand
end

#_operatorObject



397
398
399
# File 'lib/grammar/ruby/code.rb', line 397

def _operator
    "!"
end

#_step(after) ⇒ Object



412
413
414
# File 'lib/grammar/ruby/code.rb', line 412

def _step(after)
    @operand._step(after)
end