Class: Grammar::Ruby::Code::Dot

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

#_always, #_codes, #_never

Methods inherited from Grammar::Ruby::Code

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

Constructor Details

#initialize(receiver, method) ⇒ Dot

Returns a new instance of Dot.



417
418
419
420
# File 'lib/grammar/ruby/code.rb', line 417

def initialize(receiver, method)
    @operand = receiver
    @method = method
end

Dynamic Method Handling

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

Instance Method Details

#_dataObject



421
422
423
# File 'lib/grammar/ruby/code.rb', line 421

def _data
    @method
end

#_lines(text, indent = 0, op = nil, maxlen = 72) ⇒ Object



427
428
429
430
431
# File 'lib/grammar/ruby/code.rb', line 427

def _lines(text, indent=0, op=nil, maxlen=72)
    @operand._lines(text, indent, op, maxlen)
ensure
    (text.last << ?\.).concat(@method)
end

#_operatorObject



424
425
426
# File 'lib/grammar/ruby/code.rb', line 424

def _operator
    @method
end