Class: Core::Services::Accounts
- Defined in:
- lib/core/services/accounts.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from Core::Services::Base
Instance Method Details
#get_by_username(username) ⇒ Object
4 5 6 7 8 9 10 11 12 13 |
# File 'lib/core/services/accounts.rb', line 4 def get_by_username(username) account = Core::Models::Account.find_by(username: username) if account.nil? raise Core::Helpers::Errors::NotFound.new( field: 'username', error: 'unknown' ) end account end |