summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2010-10-08 23:37:31 -0700
committerDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2010-10-08 23:37:31 -0700
commit144054558ff849b204eefc57d30c00e182270660 (patch)
treeabb46c24718ded1b01394903431d44482d739851
parentd6be58113cd53de5c64ddec97fe525dbc3bed421 (diff)
downloadomptagger-144054558ff849b204eefc57d30c00e182270660.tar.gz
omptagger-144054558ff849b204eefc57d30c00e182270660.tar.xz
More abstraction.
-rwxr-xr-xomptagger28
1 files changed, 19 insertions, 9 deletions
diff --git a/omptagger b/omptagger
index 205717b..3d33675 100755
--- a/omptagger
+++ b/omptagger
@@ -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)