Class: Hotify::Users

Inherits:
Object
  • Object
show all
Defined in:
lib/hotify/user.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.find_by(email:) ⇒ Object



3
4
5
6
7
8
9
10
11
12
# File 'lib/hotify/user.rb', line 3

def self.find_by(email:)
  users = user_filter_by(email: email) 
  if users.size > 1
    raise("#{email}: Found Multiple User Entry")
  elsif users.empty?
    raise("#{email}: User Not Found")
  end

  users.first
end

Instance Method Details

#all_usersObject



14
15
16
# File 'lib/hotify/user.rb', line 14

def all_users
  client.get_users
end