module Movescount::Concern::Member
Public Class Methods
included(base)
click to toggle source
# File lib/movescount/concern/member.rb, line 4 def self.included(base) base.extend ClassMethods end
Public Instance Methods
movescount_member()
click to toggle source
Returns the Movescount
Member
object
# File lib/movescount/concern/member.rb, line 9 def movescount_member return unless self[movescount_options[:email_column]] @movescount_member ||= Movescount::Member.new(email: self[movescount_options[:email_column]], userkey: movescount_userkey) end
Private Instance Methods
movescount_options()
click to toggle source
Get the set options. Getting the defaults is ugly with send but its ok for now
# File lib/movescount/concern/member.rb, line 17 def movescount_options self.class.movescount_options || self.class.send(:movescount) end
movescount_userkey()
click to toggle source
Returns the user's movescount user key
# File lib/movescount/concern/member.rb, line 22 def movescount_userkey unless self[movescount_options[:userkey_column]] self[movescount_options[:userkey_column]] = SecureRandom.base58(15) save! if persisted? end self[movescount_options[:userkey_column]] end