Class: OpenStax::Accounts::Account
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- OpenStax::Accounts::Account
- Defined in:
- app/models/openstax/accounts/account.rb
Direct Known Subclasses
Constant Summary collapse
- USERNAME_DISCARDED_CHAR_REGEX =
/[^A-Za-z\d_]/- USERNAME_MAX_LENGTH =
50
Instance Attribute Summary collapse
-
#syncing ⇒ Object
Returns the value of attribute syncing.
Instance Method Summary collapse
- #casual_name ⇒ Object
- #has_authenticated? ⇒ Boolean
- #is_anonymous? ⇒ Boolean
- #name ⇒ Object
- #valid_openstax_uid? ⇒ Boolean
Instance Attribute Details
#syncing ⇒ Object
Returns the value of attribute syncing.
7 8 9 |
# File 'app/models/openstax/accounts/account.rb', line 7 def syncing @syncing end |
Instance Method Details
#casual_name ⇒ Object
40 41 42 |
# File 'app/models/openstax/accounts/account.rb', line 40 def casual_name first_name || username end |
#has_authenticated? ⇒ Boolean
48 49 50 |
# File 'app/models/openstax/accounts/account.rb', line 48 def has_authenticated? !access_token.nil? end |
#is_anonymous? ⇒ Boolean
44 45 46 |
# File 'app/models/openstax/accounts/account.rb', line 44 def is_anonymous? false end |
#name ⇒ Object
36 37 38 |
# File 'app/models/openstax/accounts/account.rb', line 36 def name (first_name || last_name) ? [first_name, last_name].compact.join(" ") : username end |
#valid_openstax_uid? ⇒ Boolean
52 53 54 |
# File 'app/models/openstax/accounts/account.rb', line 52 def valid_openstax_uid? !openstax_uid.nil? && openstax_uid > 0 end |