Class: Delorean::GetAttr

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

Instance Method Summary collapse

Instance Method Details

#check(_context) ⇒ Object



385
386
387
# File 'lib/delorean/nodes.rb', line 385

def check(_context, *)
  []
end

#rewrite(_context, vcode) ⇒ Object



389
390
391
392
393
# File 'lib/delorean/nodes.rb', line 389

def rewrite(_context, vcode)
  attr = i.text_value
  attr = "'#{attr}'" unless attr =~ /\A[0-9]+\z/
  "_get_attr(#{vcode}, #{attr}, _e)"
end