Sha256: f9432e4047018851b6ae1f656fbc8cee39539e33cb19216b85e450403780cb12

Contents?: true

Size: 590 Bytes

Versions: 10

Compression:

Stored size: 590 Bytes

Contents

# frozen_string_literal: true

module ActionNetworkRest
  class EntryPoint < Vertebrae::Model
    def base_path
      ''
    end

    def get
      response = client.get_request base_path
      response.body
    end

    def authenticated_successfully?
      response_body = get

      # If we successfully authenticated, the entrypoint response will include a reference to tags.
      # If not (API key missing or wrong), the response will not include anything about tags,
      # but will otherwise be successful.
      response_body.dig('_links', 'osdi:tags').present?
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
action_network_rest-0.12.0 lib/action_network_rest/entry_point.rb
action_network_rest-1.0.1 lib/action_network_rest/entry_point.rb
action_network_rest-1.0.0 lib/action_network_rest/entry_point.rb
action_network_rest-0.11.0 lib/action_network_rest/entry_point.rb
action_network_rest-0.10.0 lib/action_network_rest/entry_point.rb
action_network_rest-0.9.0 lib/action_network_rest/entry_point.rb
action_network_rest-0.8.2 lib/action_network_rest/entry_point.rb
action_network_rest-0.8.1 lib/action_network_rest/entry_point.rb
action_network_rest-0.8.0 lib/action_network_rest/entry_point.rb
action_network_rest-0.7.0 lib/action_network_rest/entry_point.rb