Module: IoTools::Importer::ClassMethods

Defined in:
lib/io_tools/importer.rb

Instance Method Summary collapse

Instance Method Details

#collect(*args, &block) ⇒ Object



15
16
17
18
19
# File 'lib/io_tools/importer.rb', line 15

def collect *args, &block
  define_method :collection do
    @collection ||= block_given? ? instance_eval(&block) : send(args.first)
  end
end

#conform(&block) ⇒ Object



21
22
23
24
25
# File 'lib/io_tools/importer.rb', line 21

def conform &block
  define_method :conform do |post|
    block.call(post, ItemStruct.new)
  end
end