Class/Module Index [+]

Quicksearch

Gorillib::Factory::EnumerableFactory

Attributes

items_factory[R]
receive

factory for converting items

Public Class Methods

new(options={}) click to toggle source
# File lib/gorillib/factories.rb, line 473
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 479
def blankish?(obj)    obj.nil? ; end
convert(obj) click to toggle source
# File lib/gorillib/factories.rb, line 486
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 482
def empty_product
  @product.new
end
native?(obj) click to toggle source
# File lib/gorillib/factories.rb, line 480
def native?(obj)      false    ; end

[Validate]

Generated with the Darkfish Rdoc Generator 2.