Sha256: be43a2ba0277fa0f521bf6842a4891eaba410841b8ca7a1a383ea483ab07064d

Contents?: true

Size: 495 Bytes

Versions: 12

Compression:

Stored size: 495 Bytes

Contents

module WLang
  class Scope
    class NullScope < Scope

      def initialize
        super(nil)
      end

      def fetch(key, dialect = nil, unfound = nil)
        unfound ? unfound.call : throw(:fail)
      end

      def subjects
        []
      end

      def inspect
        "NullScope"
      end
      alias :to_s :inspect

    protected

      def append(x)
        x
      end

      def prepend(x)
        x
      end

    end # class NullScope
  end # class Scope
end # module WLang

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
wlang-3.0.1 lib/wlang/scope/null_scope.rb
wlang-3.0.0 lib/wlang/scope/null_scope.rb
wlang-2.3.1 lib/wlang/scope/null_scope.rb
wlang-2.3.0 lib/wlang/scope/null_scope.rb
wlang-2.2.4 lib/wlang/scope/null_scope.rb
wlang-2.2.3 lib/wlang/scope/null_scope.rb
wlang-2.2.2 lib/wlang/scope/null_scope.rb
wlang-2.2.1 lib/wlang/scope/null_scope.rb
wlang-2.2.0 lib/wlang/scope/null_scope.rb
wlang-2.1.2 lib/wlang/scope/null_scope.rb
wlang-2.1.1 lib/wlang/scope/null_scope.rb
wlang-2.1.0 lib/wlang/scope/null_scope.rb