-
-
Save nuke99/74840aae2b3a52865850 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
class Storage | |
def initialize | |
@info = {'photoshop'=>'this is used for photos hoped','photomas'=>'this is a photo editing tool','dreamviwer'=>'used for web design'} | |
end | |
def output | |
@info.each do |k,v| | |
puts "#{k} #{v} " | |
end | |
end | |
def search(lis) | |
# k =~ query or v =~ query | |
@info.each do |k,v| | |
if (k =~ lis or v =~ lis) | |
puts "#{v} #{k}" | |
end | |
end | |
end | |
end | |
c = Storage.new() | |
c.search("photo") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment