module Nark::ClassMethods
Public Instance Methods
collection_name(value = nil)
click to toggle source
# File lib/nark.rb, line 29 def collection_name(value = nil) @collection_name = value if value @collection_name end
emit(narks = {})
click to toggle source
# File lib/nark.rb, line 34 def emit(narks = {}) return if narks.empty? nark_hash = narks.each_with_object(Hash.new { |h, k| h[k] = [] }) do |nark, hash| hash[nark.collection_name] << nark.serializable_hash end Nark.emitter.emit_bulk(nark_hash) end