Module: Tekeya::Entity::ClassMethods

Defined in:
lib/tekeya/entity.rb

Instance Method Summary collapse

Instance Method Details

#after_blocking_entity(callback) ⇒ Object

Sets an after callback to be run after an entity is blocked

Parameters:

  • callback (Symbol, String)

    the method to be run



115
116
117
# File 'lib/tekeya/entity.rb', line 115

def after_blocking_entity(callback)
  set_callback :block_entity, :after, callback
end

#after_joining_group(callback) ⇒ Object

Sets an after callback to be run after a group is joined

Parameters:

  • callback (Symbol, String)

    the method to be run



101
102
103
# File 'lib/tekeya/entity.rb', line 101

def after_joining_group(callback)
  set_callback :join_group, :after, callback
end

#after_leaving_group(callback) ⇒ Object

Sets an after callback to be run after a group is left

Parameters:

  • callback (Symbol, String)

    the method to be run



108
109
110
# File 'lib/tekeya/entity.rb', line 108

def after_leaving_group(callback)
  set_callback :leave_group, :after, callback
end

#after_tracking_entity(callback) ⇒ Object

Sets an after callback to be run after an entity is tracked

Parameters:

  • callback (Symbol, String)

    the method to be run



87
88
89
# File 'lib/tekeya/entity.rb', line 87

def after_tracking_entity(callback)
  set_callback :track_entity, :after, callback
end

#after_unblocking_entity(callback) ⇒ Object

Sets an after callback to be run after an entity is unblocked

Parameters:

  • callback (Symbol, String)

    the method to be run



122
123
124
# File 'lib/tekeya/entity.rb', line 122

def after_unblocking_entity(callback)
  set_callback :unblock_entity, :after, callback
end

#after_untracking_entity(callback) ⇒ Object

Sets an after callback to be run after an entity is untracked

Parameters:

  • callback (Symbol, String)

    the method to be run



94
95
96
# File 'lib/tekeya/entity.rb', line 94

def after_untracking_entity(callback)
  set_callback :untrack_entity, :after, callback
end

#define_tekeya_primary_key(key) ⇒ Object

Defines the primary key for Tekeya to use in relations

Parameters:

  • key (Symbol)

    the field to use as a primary key



129
130
131
# File 'lib/tekeya/entity.rb', line 129

def define_tekeya_primary_key(key)
  self.entity_primary_key = key
end