class Primalize::Many::Enumerable

Public Class Methods

new(enumerable) click to toggle source
# File lib/primalize/many.rb, line 65
def initialize enumerable
  validate! enumerable

  @enumerable = enumerable
end

Public Instance Methods

call() click to toggle source
# File lib/primalize/many.rb, line 77
def call
  raise RuntimeError,
    "Called #{inspect}#call. Please use Primalize::Many.enumerable to create primalizers for this."
end
validate!(enumerable) click to toggle source
# File lib/primalize/many.rb, line 71
def validate! enumerable
  unless %w(each map).all? { |msg| enumerable.respond_to? msg }
    raise ArgumentError, "#{self.class.inspect} must receive an Enumerable object, received #{enumerable.inspect}"
  end
end