Sha256: f0f7753bc34e8d2239aad5f8f3c8a4655ab9974b0d7b78cdcdd6f5510d2afbab

Contents?: true

Size: 559 Bytes

Versions: 5

Compression:

Stored size: 559 Bytes

Contents

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

5 entries across 5 versions & 1 rubygems

Version Path
action_network_rest-0.6.0 lib/action_network_rest/entry_point.rb
action_network_rest-0.5.0 lib/action_network_rest/entry_point.rb
action_network_rest-0.4.0 lib/action_network_rest/entry_point.rb
action_network_rest-0.3.0 lib/action_network_rest/entry_point.rb
action_network_rest-0.2.0 lib/action_network_rest/entry_point.rb