Class: Gamifier::Player

Inherits:
Model
  • Object
show all
Defined in:
lib/gamifier/models/player.rb

Defined Under Namespace

Modules: FinderMethods

Instance Attribute Summary

Attributes inherited from Model

#engine

Instance Method Summary collapse

Methods inherited from Model

#_id, #attributes, #destroy, #encode, #new?, #path, #payload_for_submission, #replace_if_successful, #save, #update_attributes

Methods included from Model::ClassMethods

#container, #mutable_attributes, #path, #reset!, #special_attributes, #store_or_get

Instance Method Details

#credit(verb, metadata = {}, options = {}) ⇒ Object



23
24
25
# File 'lib/gamifier/models/player.rb', line 23

def credit(verb,  = {}, options = {})
  engine.activities.build(.merge({:player_id => _id, :verb => verb})).save(options)
end