Sha256: 5dd0716a14705468cb573b850ed5adb48fe19a76d1b008c4cf64aa4dc87f5bcf
Contents?: true
Size: 941 Bytes
Versions: 17
Compression:
Stored size: 941 Bytes
Contents
# frozen_string_literal: true require 'eac_ruby_utils/core_ext' module EhbrsRubyUtils module Bga class Game class Image common_constructor :game, :suffix IMAGE_URL_PREFIX = 'https://x.boardgamearena.net/data/gamemedia/' # @return [String] def fs_object_id [game.code, suffix].map(&:parameterize) end # @param suffix [String] # @return [Pathname] def local_path download_to_cache unless fs_cache.stored? fs_cache.content_path.to_pathname end # @return [Addressable::URI] def url "#{IMAGE_URL_PREFIX}#{game.code}#{suffix}".to_uri end private # @return [void] def download_to_cache fs_cache.send(:assert_directory_on_path) ::EacEnvs::Http::Request.new.url(url).response.write_body(fs_cache.content_path) end end end end end
Version data entries
17 entries across 17 versions & 1 rubygems