class UncleKryon::ArtistData
Constants
- ID
Attributes
desc[RW]
facebook[RW]
id[RW]
long_name[RW]
mirrors[RW]
name[RW]
twitter[RW]
updated_albums_on[RW]
updated_aums_on[RW]
updated_pics_on[RW]
updated_releases_on[RW]
updated_scrolls_on[RW]
updated_visions_on[RW]
url[RW]
youtube[RW]
Public Class Methods
load_file(filepath)
click to toggle source
# File lib/unclekryon/data/artist_data.rb, line 65 def self.load_file(filepath) y = YAML.load_file(filepath) artist = y[ID] return artist end
new()
click to toggle source
Calls superclass method
# File lib/unclekryon/data/artist_data.rb, line 42 def initialize super() @updated_releases_on = '' @updated_albums_on = '' @updated_aums_on = '' @updated_scrolls_on = '' @updated_visions_on = '' @updated_pics_on = '' @id = '' @name = '' @long_name = '' @desc = '' @url = '' @mirrors = {} @facebook = SocialData.new @twitter = SocialData.new @youtube = SocialData.new end
Public Instance Methods
save_to_file(filepath,**options)
click to toggle source
# File lib/unclekryon/data/artist_data.rb, line 71 def save_to_file(filepath,**options) raise "Empty filepath: #{filepath}" if filepath.nil? || (filepath = filepath.strip).empty? Util.mk_dirs_from_filepath(filepath) File.open(filepath,'w') do |f| artist = {ID => self} YAML.dump(artist,f) end end
to_mini_s()
click to toggle source
# File lib/unclekryon/data/artist_data.rb, line 81 def to_mini_s return to_s(true) end
to_s(mini=false)
click to toggle source
# File lib/unclekryon/data/artist_data.rb, line 85 def to_s(mini=false) s = '' s << ('%-5s' % [@id]) s << (' | %15s' % [@name]) s << (' | %25s' % [@long_name]) s << (' | %s' % [@desc]) s << (' | fb: @%-20s' % [@facebook.username]) s << (' | tw: @%-20s' % [@twitter.username]) s << (' | yt: @%-35s' % [@youtube.username]) return s end