Class: TagFile::Document

Inherits:
Object
  • Object
show all
Includes:
Extractor, Verifier
Defined in:
lib/tagfile/document.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Document

Returns a new instance of Document.



13
14
15
16
17
18
19
20
# File 'lib/tagfile/document.rb', line 13

def initialize(path)
  @path = verify_presence_of(path)
  @filename = File.basename(@path)
  @format = verify_format_of(@path)
  @taglib = TagLib::File.new(@path)
  @tags = make_tag_attributes
  @errors = run_all_verifications
end

Instance Attribute Details

#errorsObject

Returns the value of attribute errors.



11
12
13
# File 'lib/tagfile/document.rb', line 11

def errors
  @errors
end

#pathObject (readonly)

Returns the value of attribute path.



10
11
12
# File 'lib/tagfile/document.rb', line 10

def path
  @path
end

#tagsObject (readonly)

Returns the value of attribute tags.



10
11
12
# File 'lib/tagfile/document.rb', line 10

def tags
  @tags
end