class Rubadana::Registry
Public Class Methods
new()
click to toggle source
# File lib/rubadana.rb, line 5 def initialize @mappers = Hash.new @reducers = Hash.new end
Public Instance Methods
build(params ;)
click to toggle source
# File lib/rubadana.rb, line 16 def build params ; Programmer.new(params).build(self) ; end
mapper(name ;)
click to toggle source
# File lib/rubadana.rb, line 12 def mapper name ; @mappers[name.to_sym] || raise("unknown mapper #{name.inspect}") ; end
mappers(names ;)
click to toggle source
# File lib/rubadana.rb, line 14 def mappers names ; names.map { |n| mapper n } ; end
reducer(name ;)
click to toggle source
# File lib/rubadana.rb, line 13 def reducer name ; @reducers[name.to_sym] || raise("unknown reducer #{name.inspect}") ; end
reducers(names ;)
click to toggle source
# File lib/rubadana.rb, line 15 def reducers names ; names.map { |n| reducer n } ; end
register_mapper(m ;)
click to toggle source
# File lib/rubadana.rb, line 10 def register_mapper m ; @mappers[m.name.to_sym] = m ; end
register_reducer(r ;)
click to toggle source
# File lib/rubadana.rb, line 11 def register_reducer r ; @reducers[r.name.to_sym] = r ; end