Class: EhbrsRubyUtils::Bga::Game::Image
- Inherits:
-
Object
- Object
- EhbrsRubyUtils::Bga::Game::Image
- Defined in:
- lib/ehbrs_ruby_utils/bga/game/image.rb
Constant Summary collapse
- IMAGE_URL_PREFIX =
'https://x.boardgamearena.net/data/gamemedia/'
Instance Method Summary collapse
Instance Method Details
#fs_object_id ⇒ String
15 16 17 |
# File 'lib/ehbrs_ruby_utils/bga/game/image.rb', line 15 def fs_object_id [game.code, suffix].map(&:parameterize) end |
#local_path ⇒ Pathname
21 22 23 24 |
# File 'lib/ehbrs_ruby_utils/bga/game/image.rb', line 21 def local_path download_to_cache unless fs_cache.stored? fs_cache.content_path.to_pathname end |
#url ⇒ Addressable::URI
27 28 29 |
# File 'lib/ehbrs_ruby_utils/bga/game/image.rb', line 27 def url "#{IMAGE_URL_PREFIX}#{game.code}#{suffix}".to_uri end |