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.
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/easytag/file.rb', line 7 def initialize(file) @file = file if audio_interface_class.nil? raise AudioMetadataProxyFileUnsupportedError.new( "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.
5 6 7 |
# File 'lib/easytag/file.rb', line 5 def file @file end |
Class Method Details
.open(file) ⇒ Object
block interface
19 20 21 22 23 24 25 26 |
# File 'lib/easytag/file.rb', line 19 def self.open(file) interface = self.new(file) begin yield interface if block_given? ensure interface.close if interface.respond_to?(:close) end end |