Sha256: dc6b4b0aaa54dfcc18eb28b8d4d49a0fbcb9bf004660aa290e137cd370843e50

Contents?: true

Size: 602 Bytes

Versions: 5

Compression:

Stored size: 602 Bytes

Contents

module Simplabs

  module Excellent

    module Parsing

      class CvarContext < SexpContext #:nodoc:

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

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

      end

    end

  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
excellent-2.1.1 lib/simplabs/excellent/parsing/cvar_context.rb
excellent-2.1.0 lib/simplabs/excellent/parsing/cvar_context.rb
excellent-2.0.1 lib/simplabs/excellent/parsing/cvar_context.rb
excellent-2.0.0 lib/simplabs/excellent/parsing/cvar_context.rb
excellent-1.7.2 lib/simplabs/excellent/parsing/cvar_context.rb