Class: Fontist::Resources::GoogleResource
- Inherits:
-
Object
- Object
- Fontist::Resources::GoogleResource
- Defined in:
- lib/fontist/resources/google_resource.rb
Instance Method Summary collapse
- #files(source_names) ⇒ Object
-
#initialize(resource, options = {}) ⇒ GoogleResource
constructor
A new instance of GoogleResource.
Constructor Details
#initialize(resource, options = {}) ⇒ GoogleResource
Returns a new instance of GoogleResource.
4 5 6 7 |
# File 'lib/fontist/resources/google_resource.rb', line 4 def initialize(resource, = {}) @resource = resource @options = end |
Instance Method Details
#files(source_names) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/fontist/resources/google_resource.rb', line 9 def files(source_names) cached_paths = download_fonts(source_names) cached_paths.map do |path| Dir.mktmpdir do |dir| FileUtils.cp(path, dir) yield File.join(dir, File.basename(path)) end end end |