Class: Devrant::Users

Inherits:
Object
  • Object
show all
Includes:
Devrant, HTTParty
Defined in:
lib/devrant/users.rb

Constant Summary

Constants included from Devrant

VERSION

Instance Method Summary collapse

Methods included from Devrant

#structuralize

Instance Method Details

#get_user(id) ⇒ Object

Raises:

  • (ArgumentError)


6
7
8
9
10
11
12
# File 'lib/devrant/users.rb', line 6

def get_user(id)
  user = structuralize(self.class.get("/users/#{id}")).profile

  return user unless user.nil?

  raise ArgumentError.new("No user found for id #{id}")
end