Class: Trxl::OffsetAccessExpression

Inherits:
Treetop::Runtime::SyntaxNode
  • Object
show all
Defined in:
lib/trxl/trxl.rb

Instance Method Summary collapse

Instance Method Details

#left_associative_apply(ruby_object, offsets) ⇒ Object



266
267
268
# File 'lib/trxl/trxl.rb', line 266

def left_associative_apply(ruby_object, offsets)
  offsets.inject(ruby_object) { |obj, offset| obj = obj[offset] }
end