Sha256: 6110e825f0aed500dc01c45dce02b942b6eddf1bb257c6d7c82ee3cd24ab8862

Contents?: true

Size: 522 Bytes

Versions: 6

Compression:

Stored size: 522 Bytes

Contents

module Dentaku
  module AST
    class Access
      def self.arity
        2
      end

      def self.peek(*)
      end

      def initialize(data_structure, index)
        @structure = data_structure
        @index = index
      end

      def value(context = {})
        structure = @structure.value(context)
        index = @index.value(context)
        structure[index]
      end

      def dependencies(context = {})
        @structure.dependencies(context) + @index.dependencies(context)
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
dentaku-3.3.2 lib/dentaku/ast/access.rb
dentaku-3.3.1 lib/dentaku/ast/access.rb
dentaku-3.3.0 lib/dentaku/ast/access.rb
dentaku-3.2.1 lib/dentaku/ast/access.rb
dentaku-3.2.0 lib/dentaku/ast/access.rb
dentaku-3.1.0 lib/dentaku/ast/access.rb