Class: EasyTag::File
Instance Attribute Summary collapse
-
#file ⇒ Object
readonly
Returns the value of attribute file.
Attributes inherited from Base
Class Method Summary collapse
-
.open(file) ⇒ Object
block interface.
Instance Method Summary collapse
-
#initialize(file) ⇒ File
constructor
A new instance of File.
Methods inherited from Base
build_proxy_methods, #proxy_getter
Constructor Details
#initialize(file) ⇒ File
Returns a new instance of File.
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/easytag/file.rb', line 9 def initialize(file) @file = file if audio_interface_class.nil? raise EasyTagFileUnsupportedError, "Couldn't determine which interface to use" end @interface = audio_interface_class.new(file) end |
Instance Attribute Details
#file ⇒ Object (readonly)
Returns the value of attribute file.
7 8 9 |
# File 'lib/easytag/file.rb', line 7 def file @file end |
Class Method Details
.open(file) ⇒ Object
block interface
21 22 23 24 25 26 27 28 |
# File 'lib/easytag/file.rb', line 21 def self.open(file) interface = self.new(file) begin yield interface if block_given? ensure interface.close if interface.respond_to?(:close) end end |