Class: Core::Services::Accounts

Inherits:
Base
  • Object
show all
Defined in:
lib/core/services/accounts.rb

Instance Attribute Summary

Attributes inherited from Base

#services

Instance Method Summary collapse

Methods inherited from Base

#initialize

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)
   = Core::Models::.find_by(username: username)
  if .nil?
    raise Core::Helpers::Errors::NotFound.new(
      field: 'username',
      error: 'unknown'
    )
  end
  
end