Sha256: 16297d0cb08399a85ca6265b8cedc43abb0c929c275e3438835e85f9f0047e6a

Contents?: true

Size: 812 Bytes

Versions: 4

Compression:

Stored size: 812 Bytes

Contents

require 'yoda/typing/contexts/base_context'

module Yoda
  module Typing
    module Contexts
      # Block context which has its lexical scope (for instance_eval and instance_exec)
      class NamespaceBlockContext < BaseContext
        # @return [Store::Objects::NamespaceObject]
        attr_reader :objects

        # @param namespaces [Array<Store::Objects::NamespaceObject>] namespace objects which context resolution and method definition refer
        def initialize(objects:, **kwargs)
          @objects = objects
          super(**kwargs)
        end

        # @return [Array<Store::Objects::NamespaceObject>]
        def current_objects
          objects
        end

        # @return [Context, nil]
        def parent_variable_scope_context
          parent
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
yoda-language-server-0.10.1 lib/yoda/typing/contexts/namespace_block_context.rb
yoda-language-server-0.10.0 lib/yoda/typing/contexts/namespace_block_context.rb
yoda-language-server-0.9.0 lib/yoda/typing/contexts/namespace_block_context.rb
yoda-language-server-0.8.0 lib/yoda/typing/contexts/namespace_block_context.rb