Module: Idnow::API::DocumentDefinitions
- Included in:
- Client
- Defined in:
- lib/idnow/API/document_definitions.rb
Instance Method Summary collapse
- #create_document_definition(document_data) ⇒ Object
-
#list_cached_document_definitions(refresh = false) ⇒ Object
rubocop:disable Style/OptionalBooleanParameter.
- #list_document_definitions ⇒ Object
Instance Method Details
#create_document_definition(document_data) ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/idnow/API/document_definitions.rb', line 6 def create_document_definition(document_data) raise Idnow::AuthenticationException if @auth_token.nil? path = full_path_for('documentdefinitions') request = Idnow::PostJsonRequest.new(path, document_data) execute(request, { 'X-API-LOGIN-TOKEN' => @auth_token }) end |
#list_cached_document_definitions(refresh = false) ⇒ Object
rubocop:disable Style/OptionalBooleanParameter
25 26 27 28 29 |
# File 'lib/idnow/API/document_definitions.rb', line 25 def list_cached_document_definitions(refresh = false) # rubocop:disable Style/OptionalBooleanParameter return @list_cached_document_definitions = list_document_definitions if refresh @list_cached_document_definitions ||= list_document_definitions end |
#list_document_definitions ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/idnow/API/document_definitions.rb', line 14 def list_document_definitions raise Idnow::AuthenticationException if @auth_token.nil? path = full_path_for('documentdefinitions') request = Idnow::GetRequest.new(path) response = execute(request, { 'X-API-LOGIN-TOKEN' => @auth_token }) response.data.map do |data| Idnow::DocumentDefinition.new(data) end end |