Sha256: 692183071d89ae3519bd69b7940c6e7f779d5f6ff7da853a589ca8f391b15516

Contents?: true

Size: 771 Bytes

Versions: 15

Compression:

Stored size: 771 Bytes

Contents

module Index
  
  # This class is for multiple types.
  #
  # For example, you could have types books, isbn.
  #
  class Type
    
    attr_reader :name, :result_type, :categories, :combinator
    
    each_delegate :generate_caches, :load_from_cache, :to => :categories
    
    # TODO Use config
    #
    def initialize name, result_type, ignore_unassigned_tokens, *categories
      @name        = name
      @result_type = result_type # TODO Move.
      @categories  = categories # for each_delegate
      @combinator  = Query::Combinator.new @categories, :ignore_unassigned_tokens => ignore_unassigned_tokens # TODO pass this in?
    end
    
    #
    #
    def possible_combinations token
      @combinator.possible_combinations_for token
    end
    
  end
  
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
picky-0.3.0 lib/picky/index/type.rb
picky-0.2.4 lib/picky/index/type.rb
picky-0.2.3 lib/picky/index/type.rb
picky-0.2.2 lib/picky/index/type.rb
picky-0.2.1 lib/picky/index/type.rb
picky-0.2.0 lib/picky/index/type.rb
picky-0.1.0 lib/picky/index/type.rb
picky-0.0.9 lib/picky/index/type.rb
picky-0.0.8 lib/picky/index/type.rb
picky-0.0.7 lib/picky/index/type.rb
picky-0.0.6 lib/picky/index/type.rb
picky-0.0.5 lib/picky/index/type.rb
picky-0.0.4 lib/picky/index/type.rb
picky-0.0.3 lib/picky/index/type.rb
picky-0.0.2 lib/picky/index/type.rb