Module: GSA::Injector

Included in:
ReadableResults, RecordsConverter, XMLizer
Defined in:
lib/gsa/modules/injector.rb

Instance Method Summary collapse

Instance Method Details

#inject(injected, items, &block) ⇒ Object



12
13
14
# File 'lib/gsa/modules/injector.rb', line 12

def inject(injected, items, &block)
  items.each.inject(injected) {|result, item| result << block.call(item)}
end

#inject_a(items, &block) ⇒ Object



8
9
10
# File 'lib/gsa/modules/injector.rb', line 8

def inject_a(items, &block)
  inject([], items, &block)
end

#inject_s(items, &block) ⇒ Object



4
5
6
# File 'lib/gsa/modules/injector.rb', line 4

def inject_s(items, &block)
  inject("", items, &block)
end