Sha256: ba6311a2d788c43c4bbcfc7f03179b2c2e1de99e865df2d2df8e0f3a12e820d0

Contents?: true

Size: 643 Bytes

Versions: 69

Compression:

Stored size: 643 Bytes

Contents

module Picky

  module Generators
    
    module Partial
      extend Helpers::Identification
      
      def self.from thing, index_name = nil, category_name = nil
        return Default unless thing

        if thing.respond_to? :each_partial
          thing
        else
          raise <<-ERROR
partial options #{identifier_for(index_name, category_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

Version data entries

69 entries across 69 versions & 1 rubygems

Version Path
picky-4.31.3 lib/picky/generators/partial.rb
picky-4.31.2 lib/picky/generators/partial.rb
picky-4.31.1 lib/picky/generators/partial.rb
picky-4.31.0 lib/picky/generators/partial.rb
picky-4.30.0 lib/picky/generators/partial.rb
picky-4.29.0 lib/picky/generators/partial.rb
picky-4.28.1 lib/picky/generators/partial.rb
picky-4.27.1 lib/picky/generators/partial.rb
picky-4.27.0 lib/picky/generators/partial.rb
picky-4.26.2 lib/picky/generators/partial.rb
picky-4.26.1 lib/picky/generators/partial.rb
picky-4.26.0 lib/picky/generators/partial.rb
picky-4.25.3 lib/picky/generators/partial.rb
picky-4.25.2 lib/picky/generators/partial.rb
picky-4.25.1 lib/picky/generators/partial.rb
picky-4.25.0 lib/picky/generators/partial.rb
picky-4.24.0 lib/picky/generators/partial.rb
picky-4.23.2 lib/picky/generators/partial.rb
picky-4.23.1 lib/picky/generators/partial.rb
picky-4.23.0 lib/picky/generators/partial.rb