refactored source code, work on pixiv integration

This commit is contained in:
albert
2011-09-26 16:47:22 -04:00
parent 11b623c66b
commit 284141aace
19 changed files with 201 additions and 45 deletions

View File

@@ -3,11 +3,23 @@ module Sources
class Base
attr_reader :url, :agent
def self.url_match?(url)
false
end
def initialize(url)
@url = url
@agent = create_agent
end
def get
raise NotImplementedError
end
def site_name
raise NotImplementedError
end
def artist_name
raise NotImplementedError
end
@@ -24,6 +36,18 @@ module Sources
raise NotImplementedError
end
def artist_alias
nil
end
def unique_id
artist_name
end
def artist_record
Artist.other_names_match(artist_name)
end
protected
def create_agent
raise NotImplementedError