Class: ID3Tag::Frames::V2::GenreFrame::GenreParser
- Inherits:
-
Object
- Object
- ID3Tag::Frames::V2::GenreFrame::GenreParser
- Defined in:
- lib/id3tag/frames/v2/genre_frame/genre_parser.rb
Direct Known Subclasses
Constant Summary collapse
- NUMERIC =
/\A\d+\z/
Instance Attribute Summary collapse
-
#genre_string ⇒ Object
readonly
Returns the value of attribute genre_string.
Instance Method Summary collapse
- #expand_abbreviation(abbreviation) ⇒ Object
- #genres ⇒ Object
-
#initialize(genre_string) ⇒ GenreParser
constructor
A new instance of GenreParser.
Constructor Details
#initialize(genre_string) ⇒ GenreParser
Returns a new instance of GenreParser.
9 10 11 |
# File 'lib/id3tag/frames/v2/genre_frame/genre_parser.rb', line 9 def initialize(genre_string) @genre_string = genre_string end |
Instance Attribute Details
#genre_string ⇒ Object (readonly)
Returns the value of attribute genre_string.
7 8 9 |
# File 'lib/id3tag/frames/v2/genre_frame/genre_parser.rb', line 7 def genre_string @genre_string end |
Instance Method Details
#expand_abbreviation(abbreviation) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/id3tag/frames/v2/genre_frame/genre_parser.rb', line 13 def (abbreviation) case abbreviation when 'CR' 'Cover' when 'RX' 'Remix' else if abbreviation =~ NUMERIC Util::GenreNames.find_by_id(abbreviation.to_i) else abbreviation end end end |
#genres ⇒ Object
28 29 30 |
# File 'lib/id3tag/frames/v2/genre_frame/genre_parser.rb', line 28 def genres raise "#genres is not implemented for class #{self.class}" end |