Class: ID3Tag::Scope
- Inherits:
-
Object
- Object
- ID3Tag::Scope
- Defined in:
- lib/id3tag/scope.rb
Constant Summary collapse
- UnsupportedScopeError =
Class.new(ArgumentError)
- SUPPORTED_SCOPES =
[:v1, :v2, :all]
Instance Method Summary collapse
- #include?(version) ⇒ Boolean
-
#initialize(version) ⇒ Scope
constructor
A new instance of Scope.
Constructor Details
#initialize(version) ⇒ Scope
Returns a new instance of Scope.
6 7 8 9 10 11 12 13 |
# File 'lib/id3tag/scope.rb', line 6 def initialize(version) raise UnsupportedScopeError unless SUPPORTED_SCOPES.include?(version) if version == :all @included_versions = [:v1, :v2] else @included_versions = [version] end end |
Instance Method Details
#include?(version) ⇒ Boolean
15 16 17 |
# File 'lib/id3tag/scope.rb', line 15 def include?(version) @included_versions.include?(version) end |