Class: DocFox::DocumentToken::ListService
- Inherits:
-
BaseService
- Object
- BaseService
- DocFox::DocumentToken::ListService
- Includes:
- Enumerable
- Defined in:
- lib/doc_fox/document_token/list_service.rb
Instance Attribute Summary collapse
-
#document_id ⇒ Object
readonly
Returns the value of attribute document_id.
Instance Method Summary collapse
-
#initialize(document_id:, page: 1, per_page: Float::INFINITY) ⇒ ListService
constructor
List document tokens.
Methods included from Enumerable
Constructor Details
#initialize(document_id:, page: 1, per_page: Float::INFINITY) ⇒ ListService
List document tokens.
Examples
service = DocFox::DocumentToken::ListService.call(document_id: '').first
service.id
service.expiry
If you don't provide the per_page argument, multiple API requests will be made untill all records have been
returned. You could be rate limited, so use wisely.
DocFox::DocumentToken::ListService.call(document_id: '', page: 1, per_page: 10).map { _1 }
GET /api/v2/documents/:document_id/document_tokens
26 27 28 29 30 31 32 33 34 35 |
# File 'lib/doc_fox/document_token/list_service.rb', line 26 def initialize(document_id:, page: 1, per_page: Float::INFINITY) @document_id = document_id super( path: "documents/#{document_id}/document_tokens", facade_klass: DocFox::DocumentToken::Facade, page: page, per_page: per_page ) end |
Instance Attribute Details
#document_id ⇒ Object (readonly)
Returns the value of attribute document_id.
6 7 8 |
# File 'lib/doc_fox/document_token/list_service.rb', line 6 def document_id @document_id end |