Class: DocFox::User::GetService

Inherits:
BaseService
  • Object
show all
Defined in:
lib/doc_fox/user/get_service.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:) ⇒ GetService

Returns a new instance of GetService.



12
13
14
# File 'lib/doc_fox/user/get_service.rb', line 12

def initialize(id:)
  @id = id
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



4
5
6
# File 'lib/doc_fox/user/get_service.rb', line 4

def id
  @id
end

Instance Method Details

#callObject

Get a user.

https://www.docfoxapp.com/api/v2/documentation#tag/Users/paths/~1api~1v2~1users~1%7Buser_id%7D/get

Examples

service = DocFox::User::GetService.call(id: '')

service.success? # => true
service.errors # => #<ActiveModel::Errors []>

service.response # => #<Faraday::Response ...>
service.response.status # => 200
service.response.body # => {}

service.facade # => #<DocFox::User::Facade ...>
service.facade.id
service.id

GET /api/v2/users/:id



36
37
38
# File 'lib/doc_fox/user/get_service.rb', line 36

def call
  connection.get("users/#{id}")
end