Module: IoTools::Importer::ClassMethods
- Defined in:
- lib/io_tools/importer.rb
Instance Method Summary collapse
Instance Method Details
permalink #collect(*args, &block) ⇒ Object
[View source]
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 |
permalink #conform(&block) ⇒ Object
[View source]
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 |