Module: Replay::Publisher::ClassMethods

Defined in:
lib/replay/publisher.rb

Instance Method Summary collapse

Instance Method Details

#apply(event_type, &block) ⇒ Object



58
59
60
# File 'lib/replay/publisher.rb', line 58

def apply(event_type, &block)
  @application_blocks[stringify_class(event_type)] = block
end

#block_for(event_type) ⇒ Object



62
63
64
65
# File 'lib/replay/publisher.rb', line 62

def block_for(event_type)
  blk = @application_blocks[stringify_class(event_type)]
  return blk
end

#key(keysym) ⇒ Object



50
51
52
# File 'lib/replay/publisher.rb', line 50

def key(keysym)
  @primary_key_method = keysym
end

#key_attrObject



54
55
56
# File 'lib/replay/publisher.rb', line 54

def key_attr
  @primary_key_method
end

#stringify_class(klass) ⇒ Object



67
68
69
# File 'lib/replay/publisher.rb', line 67

def stringify_class(klass)
  Replay::Inflector.underscore(klass.to_s.dup)
end