Module: Eve::API::Services::Misc

Defined in:
lib/eve/api/services/misc.rb

Instance Method Summary collapse

Instance Method Details

#character_portrait(character_id, options = { :size => 64 }) ⇒ Object

Returns a binary String representing a JPEG image that is the portrait of the character with the specified ID.

Optionally, the :size may be set to 64x64 or 256x256. This defaults to 64x64.

Example:

api.character_portrait(661196469)


13
14
15
16
17
18
19
20
# File 'lib/eve/api/services/misc.rb', line 13

def character_portrait(character_id, options = { :size => 64 })
  options[:s] ||= options.delete(:size)
  options[:c] ||= character_id
  request('', 'serv', options.reverse_merge(:base_uri => 'http://img.eve.is',
                                            :extension => 'asp',
                                            :camelize => false,
                                            :response_type => :string))
end