Class: EhbrsRubyUtils::Bga::Game::Image

Inherits:
Object
  • Object
show all
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_idString

Returns:

  • (String)


14
15
16
# File 'lib/ehbrs_ruby_utils/bga/game/image.rb', line 14

def fs_object_id
  [game.code, suffix].map(&:parameterize)
end

#local_pathPathname

Parameters:

  • suffix (String)

Returns:

  • (Pathname)


20
21
22
23
# File 'lib/ehbrs_ruby_utils/bga/game/image.rb', line 20

def local_path
  download_to_cache unless fs_cache.stored?
  fs_cache.content_path.to_pathname
end

#urlAddressable::URI

Returns:

  • (Addressable::URI)


26
27
28
# File 'lib/ehbrs_ruby_utils/bga/game/image.rb', line 26

def url
  "#{IMAGE_URL_PREFIX}#{game.code}#{suffix}".to_uri
end