Class: Delorean::ExpGetAttr

Inherits:
SNode
  • Object
show all
Defined in:
lib/delorean/nodes.rb

Instance Method Summary collapse

Instance Method Details

#check(context) ⇒ Object



622
623
624
# File 'lib/delorean/nodes.rb', line 622

def check(context, *)
  v.check(context)
end

#rewrite(context) ⇒ Object



626
627
628
629
630
631
632
633
634
# File 'lib/delorean/nodes.rb', line 626

def rewrite(context)
  attrs = ga.text_value.split('.')

  # If ga.text_value is not "", then we need to drop the 1st
  # element since it'll be "".
  attrs.shift

  attrs.inject(v.rewrite(context)) { |x, y| "_get_attr(#{x}, '#{y}', _e)" }
end