Sha256: 99a5dfddc4687f9465514bf27d505bbccfc3f964e74d698f44e743e63b2e7695

Contents?: true

Size: 594 Bytes

Versions: 8

Compression:

Stored size: 594 Bytes

Contents

module Simplabs

  module Excellent

    module Parsing

      class IvarContext < SexpContext #:nodoc:

        def initialize(exp, parent)
          super
          @name = exp[1].to_s.sub(/^@+/, '')
        end

        def full_name
          return @name if @parent.nil?
          full_name = @name
          parent = @parent
          parent = parent.parent until parent.is_a?(ClassContext) || parent.is_a?(ModuleContext) || parent.nil?
          if parent
            full_name = "@#{full_name}"
          else
            @name
          end
        end

      end

    end

  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
excellent-2.1.1 lib/simplabs/excellent/parsing/ivar_context.rb
excellent-2.1.0 lib/simplabs/excellent/parsing/ivar_context.rb
excellent-2.0.1 lib/simplabs/excellent/parsing/ivar_context.rb
excellent-2.0.0 lib/simplabs/excellent/parsing/ivar_context.rb
excellent-1.7.2 lib/simplabs/excellent/parsing/ivar_context.rb
excellent-1.7.1 lib/simplabs/excellent/parsing/ivar_context.rb
excellent-1.7.0 lib/simplabs/excellent/parsing/ivar_context.rb
excellent-1.6.0 lib/simplabs/excellent/parsing/ivar_context.rb