Sha256: 1f0541846c05a04b3643011d6906e6da0f764e88fd76746bf501eb700def9ac5

Contents?: true

Size: 770 Bytes

Versions: 3

Compression:

Stored size: 770 Bytes

Contents

# frozen_string_literal: true

module EveOnline
  module ESI
    class CharacterNotifications < Base
      API_ENDPOINT = 'https://esi.evetech.net/v2/characters/%<character_id>s/notifications/?datasource=%<datasource>s'

      attr_reader :character_id

      def initialize(options)
        super

        @character_id = options.fetch(:character_id)
      end

      def notifications
        output = []
        response.each do |notification|
          output << Models::Notification.new(notification)
        end
        output
      end
      memoize :notifications

      def scope
        'esi-characters.read_notifications.v1'
      end

      def url
        format(API_ENDPOINT, character_id: character_id, datasource: datasource)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
eve_online-0.20.0 lib/eve_online/esi/character_notifications.rb
eve_online-0.19.0 lib/eve_online/esi/character_notifications.rb
eve_online-0.18.0 lib/eve_online/esi/character_notifications.rb