Class: Hacker

Inherits:
Object
  • Object
show all
Defined in:
lib/hackersays.rb

Class Method Summary collapse

Class Method Details

.saidObject



6
7
8
9
10
11
12
# File 'lib/hackersays.rb', line 6

def self.said
  quote_url = "http://hackersays.com/quote"
  quote = JSON::load(open(quote_url).read())
  comment  = quote["c"]
  author = quote["a"] || "Some hacker"
  "#{comment} ~ #{author}"
end