Module: DogeWoof

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

Constant Summary collapse

VERSION =
"0.1.10"
@@modifiers =
['so', 'such', 'many', 'much', 'very']
@@c_modifiers =
['on the road', 'on the internet', 'in the house', 'in the city', 'in the hood', 'around the block']
@@fillers =
['adorable', 'fancy', 'bright', 'outstanding', 'wicked', 'clever', 'fantastic']
@@words =
['memory', 'bulb', 'TV', 'city', 'river', 'cake', 'Ruby', 'friends', 'sweets', 'meme', 'fashion', 'swag', 'muvee', 'money', 'Africa', 'politics']
@@c_words =
['wow', 'excite', 'amaze']

Class Method Summary collapse

Class Method Details

.generate(type, count) ⇒ Object



11
12
13
14
15
16
17
18
19
20
# File 'lib/doge_woof.rb', line 11

def generate(type, count)
  case type
    when "phrase"
      phrase(count)
    when "line"
      line(count)
    when "para"
      para(count)
  end
end

.line(count = 3) ⇒ Object



31
32
33
34
35
36
37
38
# File 'lib/doge_woof.rb', line 31

def line(count = 3)
  woof = ""
  count.times do
    woof += @@modifiers.sample.capitalize + " " + @@fillers.sample + " " + @@words.sample + " " + @@c_modifiers.sample + ". "
    woof += @@c_words.sample.capitalize + ". " if rand < 0.3
  end
  return woof_result = {"result" => woof}
end

.para(para_count = 2, line_count = 15) ⇒ Object



40
41
42
43
44
45
46
47
48
49
50
# File 'lib/doge_woof.rb', line 40

def para(para_count = 2, line_count = 15)
  woof = ""
  para_count.times do
    line_count.times do
      woof += @@modifiers.sample.capitalize + " " + @@fillers.sample + " " + @@words.sample + " " + @@c_modifiers.sample + ". "
      woof += @@c_words.sample.capitalize + ". " if rand < 0.5
    end
    woof += "\n\n"
  end
  return woof_result = {"result" => woof}
end

.phrase(count = 2) ⇒ Object



22
23
24
25
26
27
28
29
# File 'lib/doge_woof.rb', line 22

def phrase(count = 2)
  woof = ""
  count.times do
    woof += @@modifiers.sample.capitalize + " " + @@words.sample + ". "
  end
  woof += @@c_words.sample.capitalize + "."
  return woof_result = {"result" => woof}
end