Class: EveOnline::ESI::Resources::RoutesResources

Inherits:
Resource
  • Object
show all
Defined in:
lib/eve_online/esi/resources/routes_resources.rb

Constant Summary collapse

PREFERENCE =
["Shorter", "Safer", "LessSecure"]

Instance Attribute Summary

Attributes inherited from Resource

#client

Instance Method Summary collapse

Methods inherited from Resource

#default_headers, #get_request, #initialize, #post_request, #user_agent

Constructor Details

This class inherits a constructor from EveOnline::ESI::Resources::Resource

Instance Method Details

#route(origin_system_id:, destination_system_id:, preference: "Shorter", avoid_systems_ids: [], connections: [], security_penalty: 50) ⇒ Object

Parameters:

  • origin_system_id (Integer)

    Origin system ID

  • destination_system_id (Integer)

    Destination system ID

  • preference (String) (defaults to: "Shorter")

    Preference for the route. One of: "Shorter", "Safer", "LessSecure". Default: "Shorter"

  • avoid_systems_ids (Array<Integer>) (defaults to: [])

    Systems ID to avoid. Default: []

  • connections (Array<Hash>) (defaults to: [])

    Additional one-way connections (like Jump Bridges) between systems. Default: []

  • security_penalty (Integer) (defaults to: 50)

    Strictness of the path preference. Default: 50



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/eve_online/esi/resources/routes_resources.rb', line 15

def route(origin_system_id:, destination_system_id:, preference: "Shorter", avoid_systems_ids: [], connections: [], security_penalty: 50)
  response = post_request("route/#{origin_system_id}/#{destination_system_id}",
    params: {
      avoid_systems: avoid_systems_ids,
      connections: connections,
      preference: preference,
      security_penalty: security_penalty
    })

  Models::Route.new(attributes: response.body, headers: response.headers)
end