aboutsummaryrefslogtreecommitdiffstats
path: root/lib/seventy_eights/record.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/seventy_eights/record.rb')
-rw-r--r--lib/seventy_eights/record.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/seventy_eights/record.rb b/lib/seventy_eights/record.rb
new file mode 100644
index 0000000..2abbb69
--- /dev/null
+++ b/lib/seventy_eights/record.rb
@@ -0,0 +1,22 @@
+require 'nokogiri'
+require 'open-uri'
+
+module SeventyEights
+ class Record
+ attr_reader :title, :artist, :label, :catalog, :url
+
+ def initialize(title, artist, label, catalog, url)
+ @title, @artist, @label, @catalog, @url = title, artist, label, catalog, url
+ end
+
+ def to_filename
+ "#{safe @title} - #{safe @artist} - #{safe @label} - #{safe @catalog}.mp3"
+ end
+
+ private
+
+ def safe(str)
+ str.gsub('/', '-')
+ end
+ end
+end