class Concerts
Attributes
artist[RW]
date[RW]
input[RW]
venue[RW]
Public Class Methods
create_concert_obj(data)
click to toggle source
# File lib/gigs/concerts.rb, line 30 def self.create_concert_obj(data) data.each do |data| Concerts.new(data) end end
new(data)
click to toggle source
# File lib/gigs/concerts.rb, line 9 def initialize(data) data.each { |key, value| self.send(("#{key}="),value) } @@all << self end
print_concerts(artist)
click to toggle source
# File lib/gigs/concerts.rb, line 14 def self.print_concerts(artist) all.each do |data| if data.input.casecmp?(artist) puts "===================================================".colorize(:color => :cyan) puts "Artist: #{data.artist.name}".colorize(:red) puts "Venue: #{data.venue.name}".colorize(:white) puts "Date: #{data.date}".colorize(:blue) end end puts "===================================================".colorize(:color => :cyan) end
print_past_searches()
click to toggle source
# File lib/gigs/concerts.rb, line 26 def self.print_past_searches all.map { |name| name.input.split.map(&:capitalize).join(" ") }.uniq end