Class: Delorean::SafeNavigationGetAttr
Instance Method Summary collapse
Methods inherited from GetAttr
Instance Method Details
#rewrite(_context, vcode) ⇒ Object
399 400 401 402 403 |
# File 'lib/delorean/nodes.rb', line 399 def rewrite(_context, vcode) attr = i.text_value attr = "'#{attr}'" unless /\A[0-9]+\z/.match?(attr) "_safe_navigation_get_attr(#{vcode}, #{attr}, _e)" end |