class Fontist::CollectionFile

Public Class Methods

from_path(path) { |new(build_collection(io))| ... } click to toggle source
# File lib/fontist/collection_file.rb, line 8
def from_path(path)
  io = ::File.new(path, "rb")

  yield new(build_collection(io))
ensure
  io.close
end
new(ttfunk_collection) click to toggle source
# File lib/fontist/collection_file.rb, line 26
def initialize(ttfunk_collection)
  @collection = ttfunk_collection
end

Public Instance Methods

[](index) click to toggle source
# File lib/fontist/collection_file.rb, line 42
def [](index)
  FontFile.from_collection_index(@collection, index)
end
count() click to toggle source
# File lib/fontist/collection_file.rb, line 30
def count
  @collection.count
end
each() { |self| ... } click to toggle source
# File lib/fontist/collection_file.rb, line 34
def each
  count.times do |index|
    yield self[index]
  end

  self
end