Module: Cornerstone::ActsAsCornerstoneUser::InstanceMethods

Defined in:
lib/cornerstone/acts_as_cornerstone_user.rb

Instance Method Summary collapse

Instance Method Details

#cornerstone_admin?Boolean

Return true if this user is an administrator

Returns:

  • (Boolean)


65
66
67
68
69
70
71
72
73
74
# File 'lib/cornerstone/acts_as_cornerstone_user.rb', line 65

def cornerstone_admin?
  case
  when self.cornerstone_admin.is_a?(TrueClass)
    true
  when self.cornerstone_admin.respond_to?(:call)
    self.cornerstone_admin.call
  else
    false
  end
end

#cornerstone_emailObject

return the user’s email



56
57
58
59
60
61
62
# File 'lib/cornerstone/acts_as_cornerstone_user.rb', line 56

def cornerstone_email
  if self.cornerstone_email_method.present?
    self.send(self.cornerstone_email_method)
  else
    "Not Available"
  end
end

#cornerstone_nameObject

return the user’s name



47
48
49
50
51
52
53
# File 'lib/cornerstone/acts_as_cornerstone_user.rb', line 47

def cornerstone_name
  if self.cornerstone_name_method.present?
    self.send(self.cornerstone_name_method)
  else
    "Not Available"
  end
end