Class: ActionNetworkRest::EntryPoint

Inherits:
Vertebrae::Model
  • Object
show all
Defined in:
lib/action_network_rest/entry_point.rb

Instance Method Summary collapse

Instance Method Details

#authenticated_successfully?Boolean

Returns:

  • (Boolean)


14
15
16
17
18
19
20
21
# File 'lib/action_network_rest/entry_point.rb', line 14

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

#base_pathObject



5
6
7
# File 'lib/action_network_rest/entry_point.rb', line 5

def base_path
  ''
end

#getObject



9
10
11
12
# File 'lib/action_network_rest/entry_point.rb', line 9

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