Class: Adam::Image
- Inherits:
-
Object
- Object
- Adam::Image
- Defined in:
- lib/adam/image.rb
Constant Summary collapse
- @@character_portrait_uri =
"http://image.eveonline.com/Character/"
- @@corporation_logo_uri =
"http://image.eveonline.com/Corporation/"
- @@alliance_logo_uri =
"http://image.eveonline.com/Alliance/"
Class Method Summary collapse
-
.alliance_logo(options = {}) ⇒ Object
Retrieves a alliance logo.
-
.character_portrait(options = {}) ⇒ Object
Retrieves a character portrait.
-
.corporation_logo(options = {}) ⇒ Object
Retrieves a corporation logo.
Class Method Details
.alliance_logo(options = {}) ⇒ Object
Retrieves a alliance logo.
Parameters:
-
options
- A hash with these keys:-
id
- An integer describing an EVE Online character id. -
size
- An integer describing what size to retrieve. Valid sizes are 32, 64 or 128.
-
48 49 50 51 52 53 54 55 |
# File 'lib/adam/image.rb', line 48 def self.alliance_logo( = {}) id = .fetch(:id) size = .fetch(:size) raise ArgumentError, "Valid sizes are 32, 64 or 128" unless [32, 64, 128].include?(size) request(@@alliance_logo_uri + "#{id}_#{size}.png") end |
.character_portrait(options = {}) ⇒ Object
Retrieves a character portrait.
Parameters:
-
options
- A hash with these keys:-
id
- An integer describing an EVE Online character id. -
size
- An integer describing what size to retrieve. Valid sizes are 32, 64, 128 or 256.
-
18 19 20 21 22 23 24 25 |
# File 'lib/adam/image.rb', line 18 def self.character_portrait( = {}) id = .fetch(:id) size = .fetch(:size) raise ArgumentError, "Valid sizes are 32, 64, 128 or 256" unless [32, 64, 128, 256].include?(size) request(@@character_portrait_uri + "#{id}_#{size}.jpg") end |
.corporation_logo(options = {}) ⇒ Object
Retrieves a corporation logo.
Parameters:
-
options
- A hash with these keys:-
id
- An integer describing an EVE Online character id. -
size
- An integer describing what size to retrieve. Valid sizes are 32, 64, 128 or 256.
-
33 34 35 36 37 38 39 40 |
# File 'lib/adam/image.rb', line 33 def self.corporation_logo( = {}) id = .fetch(:id) size = .fetch(:size) raise ArgumentError, "Valid sizes are 32, 64, 128 or 256" unless [32, 64, 128, 256].include?(size) request(@@corporation_logo_uri + "#{id}_#{size}.png") end |