Class: RiotLolApi::Model::Image

Inherits:
Object
  • Object
show all
Includes:
Concern::Init
Defined in:
lib/riot_lol_api/models/images.rb

Instance Method Summary collapse

Methods included from Concern::Init

#initialize

Instance Method Details

#full_urlObject

build path of image



7
8
9
# File 'lib/riot_lol_api/models/images.rb', line 7

def full_url
  "#{RiotLolApi::Client.realm['cdn']}/#{RiotLolApi::Client.realm['v']}/img/#{group}/#{full}"
end

#sprite_url(size = 'normal') ⇒ Object



11
12
13
14
# File 'lib/riot_lol_api/models/images.rb', line 11

def sprite_url(size = 'normal')
  filename = size == 'tiny' || size == 'small' ? "#{size}_#{sprite}" : sprite
  "#{RiotLolApi::Client.realm['cdn']}/#{RiotLolApi::Client.realm['v']}/img/sprite/#{filename}"
end