Class: Esi::GetCharacterInfo
- Inherits:
-
Download
- Object
- Download
- Esi::GetCharacterInfo
- Defined in:
- lib/gets/get_character_info.rb
Instance Method Summary collapse
- #get(character_id) ⇒ Object
-
#initialize ⇒ GetCharacterInfo
constructor
A new instance of GetCharacterInfo.
Constructor Details
#initialize ⇒ GetCharacterInfo
Returns a new instance of GetCharacterInfo.
7 8 9 10 |
# File 'lib/gets/get_character_info.rb', line 7 def initialize super @character_infos = {} end |
Instance Method Details
#get(character_id) ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/gets/get_character_info.rb', line 12 def get( character_id ) unless @character_infos[ character_id ] @rest_url = "characters/#{character_id}/" character_data = get_page_retry_on_error @character_infos[character_id] = OpenStruct.new( character_data ) end @character_infos[character_id] end |