Sha256: 6d7cc590458331672bc31f94d6768fafd9efc26141477006e22fa6566a97af1d

Contents?: true

Size: 718 Bytes

Versions: 13

Compression:

Stored size: 718 Bytes

Contents

module PowerStencil
  module Project

    module Completion

      def query_for_completion(query_type)
        case query_type
        when :entities
          engine.entities.map(&:as_path).sort
        when :'entity-types'
          engine.available_entity_types.sort
        when :scenario
          engine.entities(criterion: :by_type, value: :entity_override) do |entity|
            !entity.scenario.nil? and !entity.scenario.empty?
          end.map(&:scenario).sort.uniq
        when :buildable
          engine.entities(&:buildable?).map(&:as_path).sort
        else
          raise PowerStencil::Error, "'#{query_type}' is not a valid query type for completion !"
        end
      end

    end

  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
power_stencil-0.10.0 lib/power_stencil/project/completion.rb
power_stencil-0.9.8 lib/power_stencil/project/completion.rb
power_stencil-0.9.7 lib/power_stencil/project/completion.rb
power_stencil-0.9.6 lib/power_stencil/project/completion.rb
power_stencil-0.9.5 lib/power_stencil/project/completion.rb
power_stencil-0.9.4 lib/power_stencil/project/completion.rb
power_stencil-0.9.3 lib/power_stencil/project/completion.rb
power_stencil-0.9.2 lib/power_stencil/project/completion.rb
power_stencil-0.9.1 lib/power_stencil/project/completion.rb
power_stencil-0.9.0 lib/power_stencil/project/completion.rb
power_stencil-0.8.14 lib/power_stencil/project/completion.rb
power_stencil-0.8.13 lib/power_stencil/project/completion.rb
power_stencil-0.8.12 lib/power_stencil/project/completion.rb