Class: DocFox::DocumentToken::GetService
- Inherits:
-
BaseService
- Object
- BaseService
- DocFox::DocumentToken::GetService
- Defined in:
- lib/doc_fox/document_token/get_service.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
-
#call ⇒ Object
Get a document token.
-
#initialize(id:, params: {}) ⇒ GetService
constructor
A new instance of GetService.
Constructor Details
#initialize(id:, params: {}) ⇒ GetService
Returns a new instance of GetService.
12 13 14 15 |
# File 'lib/doc_fox/document_token/get_service.rb', line 12 def initialize(id:, params: {}) @id = id @params = params end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/doc_fox/document_token/get_service.rb', line 4 def id @id end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
4 5 6 |
# File 'lib/doc_fox/document_token/get_service.rb', line 4 def params @params end |
Instance Method Details
#call ⇒ Object
Get a document token.
Examples
service = DocFox::DocumentToken::GetService.call(id: '')
service.success? # => true
service.errors # => #<ActiveModel::Errors []>
service.response # => #<Faraday::Response ...>
service.response.status # => 200
service.response.body # => {}
service.facade # => #<DocFox::DocumentToken::Facade ...>
service.facade.id
service.id
GET /api/v2/document_tokens/:id
37 38 39 |
# File 'lib/doc_fox/document_token/get_service.rb', line 37 def call connection.get("document_tokens/#{id}", **params) end |