Sha256: dcbc0ae96a3fc3176cfb9eb63ee7ba21c535f5384d358e3d098a7daa77f813af

Contents?: true

Size: 597 Bytes

Versions: 38

Compression:

Stored size: 597 Bytes

Contents

module Picky
  module API
    module Category

      module Partial

        def extract_partial thing
          return Generators::Partial::Default unless thing

          if thing.respond_to? :each_partial
            thing
          else
            raise <<-ERROR
partial options for #{index_name}:#{name} should be either
* for example a Partial::Substring.new(from: m, to: n), Partial::Postfix.new(from: n), Partial::Infix.new(min: m, max: n) etc.
or
* an object that responds to #each_partial(str_or_sym) and yields each partial
ERROR
          end
        end

      end

    end
  end
end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
picky-4.6.3 lib/picky/api/category/partial.rb
picky-4.6.2 lib/picky/api/category/partial.rb
picky-4.6.1 lib/picky/api/category/partial.rb
picky-4.6.0 lib/picky/api/category/partial.rb
picky-4.5.12 lib/picky/api/category/partial.rb
picky-4.5.11 lib/picky/api/category/partial.rb
picky-4.5.10 lib/picky/api/category/partial.rb
picky-4.5.9 lib/picky/api/category/partial.rb
picky-4.5.8 lib/picky/api/category/partial.rb
picky-4.5.7 lib/picky/api/category/partial.rb
picky-4.5.6 lib/picky/api/category/partial.rb
picky-4.5.5 lib/picky/api/category/partial.rb
picky-4.5.4 lib/picky/api/category/partial.rb
picky-4.5.3 lib/picky/api/category/partial.rb
picky-4.5.2 lib/picky/api/category/partial.rb
picky-4.5.1 lib/picky/api/category/partial.rb
picky-4.5.0 lib/picky/api/category/partial.rb
picky-4.4.2 lib/picky/api/category/partial.rb
picky-4.4.1 lib/picky/api/category/partial.rb
picky-4.4.0 lib/picky/api/category/partial.rb