class Fontina::MetaPackage

Attributes

location[R]

Public Class Methods

new(location) click to toggle source
# File lib/fontina/meta_package.rb, line 6
def initialize(location)
  @location = location
end

Public Instance Methods

format() click to toggle source
# File lib/fontina/meta_package.rb, line 14
def format
  @format ||= Format.for(
    mime_type: file.mime_type,
    extension: File.extname(file.filename).downcase
  )
end
package() click to toggle source
# File lib/fontina/meta_package.rb, line 21
def package
  @package ||= StringIO.open file.content, 'rb', &format.method(:read)
end
size() click to toggle source
# File lib/fontina/meta_package.rb, line 10
def size
  file.content.length
end

Private Instance Methods

file() click to toggle source
# File lib/fontina/meta_package.rb, line 27
def file
  @file ||= Fetcher.fetch location
end