Sha256: bc5d3fe51b7fafa795c230068622a3b2ddf71a7846ce892a157bb5c4cffda8b8

Contents?: true

Size: 827 Bytes

Versions: 3

Compression:

Stored size: 827 Bytes

Contents

# frozen_string_literal: true

module EveOnline
  module ESI
    class CharacterCalendar < Base
      API_PATH = "/v1/characters/%<character_id>s/calendar/"

      attr_reader :character_id, :from_event

      def initialize(options)
        super

        @character_id = options.fetch(:character_id)
        @from_event = options.fetch(:from_event, nil)
      end

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

      def scope
        "esi-calendar.read_calendar_events.v1"
      end

      def additional_query_params
        [:from_event]
      end

      def path
        format(API_PATH, character_id: character_id)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
eve_online-0.32.0 lib/eve_online/esi/character_calendar.rb
eve_online-0.31.0 lib/eve_online/esi/character_calendar.rb
eve_online-0.30.0 lib/eve_online/esi/character_calendar.rb