Sha256: e220d6ee59376b25237e19b1dce7b4d6d11c2b83d4f9dd626776cd01780edd24

Contents?: true

Size: 613 Bytes

Versions: 8

Compression:

Stored size: 613 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 = "#{parent.full_name}.#{full_name}"
          else
            @name
          end
        end

      end

    end

  end

end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
simplabs-excellent-1.4.0 lib/simplabs/excellent/parsing/ivar_context.rb
simplabs-excellent-1.4.1 lib/simplabs/excellent/parsing/ivar_context.rb
simplabs-excellent-1.4.2 lib/simplabs/excellent/parsing/ivar_context.rb
simplabs-excellent-1.5.0 lib/simplabs/excellent/parsing/ivar_context.rb
simplabs-excellent-1.5.1 lib/simplabs/excellent/parsing/ivar_context.rb
simplabs-excellent-1.5.2 lib/simplabs/excellent/parsing/ivar_context.rb
simplabs-excellent-1.5.3 lib/simplabs/excellent/parsing/ivar_context.rb
excellent-1.5.4 lib/simplabs/excellent/parsing/ivar_context.rb