class Gorillib::Factory::EnumerableFactory

Attributes

items_factory[R]
receive

factory for converting items

Public Class Methods

new(options={}) click to toggle source
Calls superclass method Gorillib::Factory::BaseFactory::new
# File lib/gorillib/factories.rb, line 486
def initialize(options={})
  @items_factory = Gorillib::Factory( options.delete(:items){ :identical } )
  redefine(:empty_product, options.delete(:empty_product)) if options.has_key?(:empty_product)
  super(options)
end

Public Instance Methods

blankish?(obj) click to toggle source
# File lib/gorillib/factories.rb, line 492
def blankish?(obj)    obj.nil? ; end
convert(obj) click to toggle source
# File lib/gorillib/factories.rb, line 499
def convert(obj)
  clxn = empty_product
  obj.each do |val|
    clxn << items_factory.receive(val)
  end
  clxn
end
empty_product() click to toggle source
# File lib/gorillib/factories.rb, line 495
def empty_product
  @product.new
end
native?(obj) click to toggle source
# File lib/gorillib/factories.rb, line 493
def native?(obj)      false    ; end