Module: Fauxster

Defined in:
lib/fauxster.rb,
lib/fauxster/version.rb

Constant Summary collapse

VERSION =
"0.0.1"

Class Method Summary collapse

Class Method Details

.craft_prose(paragraphs = 1, args = {}) ⇒ Object


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

def self.craft_prose(paragraphs = 1, args = {})
  # TODO: add error handling
	html = args.fetch(:html) { false }
	language = args.fetch(:language) { 'hipster-centric' }
	
	hipster_nonsense = HTTParty.get("http://hipsterjesus.com/api/?paras=#{paragraphs}&html=#{html}&type=#{language}")
  return hipster_nonsense['text']
end