diff options
author | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2010-10-08 23:37:31 -0700 |
---|---|---|
committer | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2010-10-08 23:37:31 -0700 |
commit | 144054558ff849b204eefc57d30c00e182270660 (patch) | |
tree | abb46c24718ded1b01394903431d44482d739851 /omptagger | |
parent | d6be58113cd53de5c64ddec97fe525dbc3bed421 (diff) | |
download | omptagger-144054558ff849b204eefc57d30c00e182270660.tar.gz omptagger-144054558ff849b204eefc57d30c00e182270660.tar.xz |
More abstraction.
Diffstat (limited to 'omptagger')
-rwxr-xr-x | omptagger | 28 |
1 files changed, 19 insertions, 9 deletions
@@ -24,16 +24,31 @@ class Metadata def output(tag, val, spacing = 2) puts ' ' + tag + ' ' * spacing + val end -end -class VorbisComment < Metadata + private :output + def view puts ' Viewing tags:' if @tags.empty? puts ' No tags set.' - return + return true end + end + + def viewtag(tag) + puts ' Viewing ' + tag + ' tag:' + + unless @tags.has_key? tag + puts ' Tag not set.' + return true + end + end +end + +class VorbisComment < Metadata + def view + return if super @tags.sort.each do |tag, val| val.each do |val| @@ -43,12 +58,7 @@ class VorbisComment < Metadata end def viewtag(tag) - puts ' Viewing ' + tag + ' tag:' - - unless @tags.has_key? tag - puts ' Tag not set.' - return - end + return if super @tags[tag].each do |val| output(tag, val) |