Sha256: 89a75ae4511fb7bffb941dcfb7ad7c2eefeea403d1b7474ec4ce9deec2910076

Contents?: true

Size: 659 Bytes

Versions: 20

Compression:

Stored size: 659 Bytes

Contents

module Simplabs

  module Excellent

    module Parsing

      module Scopeable #:nodoc:

        private

          def get_names
            if @exp[1].is_a?(Sexp)
              name = @exp[1].pop.to_s.strip
              [name, "#{extract_prefixes}#{name}"]
            else
              [@exp[1].to_s, nil]
            end
          end

          def extract_prefixes(exp = @exp[1].deep_clone, prefix = '')
            prefix = "#{exp.pop}::#{prefix}" if exp.last.is_a?(Symbol)
            if exp.last.is_a?(Sexp)
              prefix = extract_prefixes(exp.last, prefix)
            end
            prefix
          end

      end

    end

  end

end

Version data entries

20 entries across 20 versions & 2 rubygems

Version Path
simplabs-excellent-1.2.1 lib/simplabs/excellent/parsing/scopeable.rb
simplabs-excellent-1.2.2 lib/simplabs/excellent/parsing/scopeable.rb
simplabs-excellent-1.3.0 lib/simplabs/excellent/parsing/scopeable.rb
simplabs-excellent-1.3.1 lib/simplabs/excellent/parsing/scopeable.rb
simplabs-excellent-1.4.0 lib/simplabs/excellent/parsing/scopeable.rb
simplabs-excellent-1.4.1 lib/simplabs/excellent/parsing/scopeable.rb
simplabs-excellent-1.4.2 lib/simplabs/excellent/parsing/scopeable.rb
simplabs-excellent-1.5.0 lib/simplabs/excellent/parsing/scopeable.rb
simplabs-excellent-1.5.1 lib/simplabs/excellent/parsing/scopeable.rb
simplabs-excellent-1.5.2 lib/simplabs/excellent/parsing/scopeable.rb
simplabs-excellent-1.5.3 lib/simplabs/excellent/parsing/scopeable.rb
excellent-2.1.1 lib/simplabs/excellent/parsing/scopeable.rb
excellent-2.1.0 lib/simplabs/excellent/parsing/scopeable.rb
excellent-2.0.1 lib/simplabs/excellent/parsing/scopeable.rb
excellent-2.0.0 lib/simplabs/excellent/parsing/scopeable.rb
excellent-1.7.2 lib/simplabs/excellent/parsing/scopeable.rb
excellent-1.7.1 lib/simplabs/excellent/parsing/scopeable.rb
excellent-1.7.0 lib/simplabs/excellent/parsing/scopeable.rb
excellent-1.6.0 lib/simplabs/excellent/parsing/scopeable.rb
excellent-1.5.4 lib/simplabs/excellent/parsing/scopeable.rb