Sha256: 87f02eab3c9d727daa89c2a9218bc19db1b27d52e932add49c4f8a17fccb9d25

Contents?: true

Size: 725 Bytes

Versions: 3

Compression:

Stored size: 725 Bytes

Contents

# frozen_string_literal: true

module EveOnline
  module ESI
    class CharacterCalendar < Base
      API_ENDPOINT = 'https://esi.evetech.net/v1/characters/%<character_id>s/calendar/?datasource=%<datasource>s'

      attr_reader :character_id

      def initialize(options)
        super

        @character_id = options.fetch(:character_id)
      end

      def events
        output = []
        response.each do |event|
          output << Models::Event.new(event)
        end
        output
      end
      memoize :events

      def scope
        'esi-calendar.read_calendar_events.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_calendar.rb
eve_online-0.19.0 lib/eve_online/esi/character_calendar.rb
eve_online-0.18.0 lib/eve_online/esi/character_calendar.rb