Sha256: 46788d29639ac60398033c25d233c6f6516c42762c4c2f3a855a4deacf053778

Contents?: true

Size: 784 Bytes

Versions: 4

Compression:

Stored size: 784 Bytes

Contents

# frozen_string_literal: true

require 'forwardable'

module EveOnline
  module ESI
    class UniverseSystem < Base
      extend Forwardable

      API_ENDPOINT = 'https://esi.evetech.net/v4/universe/systems/%<system_id>s/?datasource=%<datasource>s'

      attr_reader :id

      def initialize(options)
        super

        @id = options.fetch(:id)
      end

      def_delegators :model, :as_json, :constellation_id, :name,
                     :security_class, :security_status, :star_id, :system_id,
                     :position, :planets, :stargate_ids, :station_ids

      def model
        @model ||= Models::System.new(response)
      end

      def scope; end

      def url
        format(API_ENDPOINT, system_id: id, datasource: datasource)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
eve_online-0.23.0 lib/eve_online/esi/universe_system.rb
eve_online-0.22.0 lib/eve_online/esi/universe_system.rb
eve_online-0.21.0 lib/eve_online/esi/universe_system.rb
eve_online-0.20.0 lib/eve_online/esi/universe_system.rb