module NewEden::Character

Constants

CHARACTER_ENDPOINTS

Public Instance Methods

all_notification_texts(character_id) click to toggle source
# File lib/neweden/character.rb, line 20
def all_notification_texts(character_id)
  n_results = self.notifications(character_id)
  if n_results[:rowset][:row].nil?
    nil
  else
    notification_ids = n_results[:rowset][:row].map { |row| row[:notificationID] }
    notification_texts(character_id, notification_ids)
  end
end
calendar_event_attendees(character_id) click to toggle source
# File lib/neweden/character.rb, line 30
def calendar_event_attendees(character_id)
  upcoming_calendar_events(character_id)
  character_request("/char/CalendarEventAttendees.xml.aspx", character_id)
end
notification_texts(character_id, *notification_ids) click to toggle source
# File lib/neweden/character.rb, line 16
def notification_texts(character_id, *notification_ids)
  request("/char/NotificationTexts.xml.aspx", :post, :characterID => character_id, :IDs => notification_ids.map { |nid| nid.to_s }.join(','))
end
upcoming_calendar_events(character_id) click to toggle source
# File lib/neweden/character.rb, line 35
def upcoming_calendar_events(character_id)
  @upcoming_events ||= {}
  @upcoming_events[character_id.to_s] ||= character_request("/char/UpcomingCalendarEvents.xml.aspx", character_id)
end

Private Instance Methods

character_request(endpoint, character_id, options = {}) click to toggle source
# File lib/neweden/character.rb, line 46
def character_request(endpoint, character_id, options = {})
  request(endpoint, :post, { :characterID => character_id }.merge(options))
end