Sha256: 85e8013b20be34fdb4c62750ad25eaaa011eb70189cb648011bd3850c8cab266

Contents?: true

Size: 724 Bytes

Versions: 1

Compression:

Stored size: 724 Bytes

Contents

# frozen_string_literal: true

require 'forwardable'

module EveOnline
  module ESI
    class UniverseStar < Base
      extend Forwardable

      API_ENDPOINT = 'https://esi.evetech.net/v1/universe/stars/%<star_id>s/?datasource=%<datasource>s'

      attr_reader :id

      def initialize(options)
        super

        @id = options.fetch(:id)
      end

      def_delegators :model, :as_json, :age, :luminosity, :name, :radius,
                     :solar_system_id, :spectral_class, :temperature, :type_id

      def model
        Models::Star.new(response)
      end
      memoize :model

      def scope; end

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
eve_online-0.20.0 lib/eve_online/esi/universe_star.rb