Class: Fontist::Import::Files::CollectionFile

Inherits:
Object
  • Object
show all
Defined in:
lib/fontist/import/files/collection_file.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ CollectionFile

Returns a new instance of CollectionFile.



11
12
13
14
15
# File 'lib/fontist/import/files/collection_file.rb', line 11

def initialize(path)
  @path = path
  @fonts = read
  @extension = detect_extension
end

Instance Attribute Details

#fontsObject (readonly)

Returns the value of attribute fonts.



9
10
11
# File 'lib/fontist/import/files/collection_file.rb', line 9

def fonts
  @fonts
end

Instance Method Details

#filenameObject



17
18
19
# File 'lib/fontist/import/files/collection_file.rb', line 17

def filename
  File.basename(@path, ".*") + "." + @extension
end

#source_filenameObject



21
22
23
# File 'lib/fontist/import/files/collection_file.rb', line 21

def source_filename
  File.basename(@path) unless filename == File.basename(@path)
end