class Minuteman::User
Public Class Methods
[](identifier_or_uuid)
click to toggle source
# File lib/minuteman/user.rb, line 43 def self.[](identifier_or_uuid) with(:uid, identifier_or_uuid) || with(:identifier, identifier_or_uuid) end
Public Instance Methods
add(action, time = Time.now.utc)
click to toggle source
# File lib/minuteman/user.rb, line 25 def add(action, time = Time.now.utc) Minuteman.add(action, time, self) end
anonymous?()
click to toggle source
# File lib/minuteman/user.rb, line 33 def anonymous? self.anonymous == true end
count(action, time = Time.now.utc)
click to toggle source
# File lib/minuteman/user.rb, line 29 def count(action, time = Time.now.utc) Minuteman::Analyzer.new(action, Minuteman::Counter::User, self) end
promote(identifier)
click to toggle source
# File lib/minuteman/user.rb, line 37 def promote(identifier) self.identifier = identifier self.anonymous = false save end
save()
click to toggle source
Calls superclass method
# File lib/minuteman/user.rb, line 15 def save self.uid ||= SecureRandom.uuid self.anonymous ||= !identifier super end
track(action, time = Time.now.utc)
click to toggle source
# File lib/minuteman/user.rb, line 21 def track(action, time = Time.now.utc) Minuteman.track(action, self, time) end