Class: EveOnline::ESI::CharacterCalendar

Inherits:
Base
  • Object
show all
Defined in:
lib/eve_online/esi/character_calendar.rb

Constant Summary collapse

API_PATH =
"/v2/characters/%<character_id>s/calendar/"

Constants inherited from Base

Base::API_HOST

Instance Attribute Summary collapse

Attributes inherited from Base

#_open_timeout, #_read_timeout, #_write_timeout, #adapter, #language, #middlewares, #token

Instance Method Summary collapse

Methods inherited from Base

#add_middleware, #base_query_params, #connection, #error_limit_remain, #error_limit_reset, #http_method, #open_timeout, #open_timeout=, #page, #query, #read_timeout, #read_timeout=, #request_id, #resource, #response, #total_pages, #uri, #url, #user_agent, #write_timeout, #write_timeout=

Constructor Details

#initialize(options) ⇒ CharacterCalendar

Returns a new instance of CharacterCalendar.



10
11
12
13
14
15
# File 'lib/eve_online/esi/character_calendar.rb', line 10

def initialize(options)
  super

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

Instance Attribute Details

#character_idObject (readonly)

Returns the value of attribute character_id.



8
9
10
# File 'lib/eve_online/esi/character_calendar.rb', line 8

def character_id
  @character_id
end

#from_eventObject (readonly)

Returns the value of attribute from_event.



8
9
10
# File 'lib/eve_online/esi/character_calendar.rb', line 8

def from_event
  @from_event
end

Instance Method Details

#additional_query_paramsObject



32
33
34
# File 'lib/eve_online/esi/character_calendar.rb', line 32

def additional_query_params
  [:from_event]
end

#eventsObject



17
18
19
20
21
22
23
24
25
26
# File 'lib/eve_online/esi/character_calendar.rb', line 17

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

#pathObject



36
37
38
# File 'lib/eve_online/esi/character_calendar.rb', line 36

def path
  format(API_PATH, character_id: character_id)
end

#scopeObject



28
29
30
# File 'lib/eve_online/esi/character_calendar.rb', line 28

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