Class: DevRuby::Resources::ProfileImagesResource

Inherits:
BaseResource
  • Object
show all
Defined in:
lib/dev_ruby/resources/profile_images_resource.rb

Instance Attribute Summary

Attributes inherited from BaseResource

#client

Instance Method Summary collapse

Methods inherited from BaseResource

#initialize

Constructor Details

This class inherits a constructor from DevRuby::Resources::BaseResource

Instance Method Details

#find_by_username(username) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/dev_ruby/resources/profile_images_resource.rb', line 6

def find_by_username(username)
  response = get_request("profile_images/#{username}")

  if Helpers.expected_response?(response, 200)
    profile_image = DevRuby::Objects::ProfileImage.new(response.body)

    Success(profile_image)
  else
    Failure(error_parser(response))
  end
end