the-office-quote-generator 0.1.8 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/office_quote_controller.rb +5 -5
- data/lib/quote.rb +5 -5
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b4bfcc5cfa7b5cd402bc34c8d77bb4d06716247a
|
|
4
|
+
data.tar.gz: 845ad6091450b83f45ced2975f97a2e98e0ad12c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a5e9b3a41ac233e8bcccd1e18b5832a8f521cb67428be57a54a74cd566b6b683059e785011dafde6334a52fc629bb8105fd3593f0a62e02cddc0d81a4a0e79aa
|
|
7
|
+
data.tar.gz: bc972886aefa6313f324a48eb1678218864bafa447e3797b43064fdb51c3550d2cd11164515bc74351085462a7b77b46c21ab32e2965275a787d533ad0b783a5
|
|
@@ -13,13 +13,13 @@ class OfficeQuoteController
|
|
|
13
13
|
puts "If you'd like to exit, enter \"exit\""
|
|
14
14
|
puts "Please select from the following options: "
|
|
15
15
|
puts "1. Choose a quote from a specific character"
|
|
16
|
-
puts "2. Hear a
|
|
16
|
+
puts "2. Hear a dialogue quote (between multiple characters)"
|
|
17
17
|
puts "3. Hear a random quote"
|
|
18
18
|
input = gets.chomp
|
|
19
19
|
if input == "1"
|
|
20
20
|
get_quotes_by_character
|
|
21
21
|
elsif input == "2"
|
|
22
|
-
|
|
22
|
+
get_dialogue_quote
|
|
23
23
|
elsif input == "3"
|
|
24
24
|
get_random_quote
|
|
25
25
|
elsif input != "exit"
|
|
@@ -48,11 +48,11 @@ class OfficeQuoteController
|
|
|
48
48
|
end
|
|
49
49
|
end
|
|
50
50
|
|
|
51
|
-
def
|
|
51
|
+
def get_dialogue_quote
|
|
52
52
|
input = ""
|
|
53
53
|
while input != "exit" && input != "n" && input != "N" do
|
|
54
|
-
Quote.
|
|
55
|
-
puts "Would you like to hear another
|
|
54
|
+
Quote.get_dialogue
|
|
55
|
+
puts "Would you like to hear another dialogue? (y/n)"
|
|
56
56
|
input = gets.chomp
|
|
57
57
|
end
|
|
58
58
|
end
|
data/lib/quote.rb
CHANGED
|
@@ -6,14 +6,14 @@ class Quote
|
|
|
6
6
|
attr_accessor :character, :content
|
|
7
7
|
|
|
8
8
|
@@all = []
|
|
9
|
-
@@
|
|
9
|
+
@@dialogue_quotes = []
|
|
10
10
|
|
|
11
11
|
def initialize(content, character="")
|
|
12
12
|
@content = content
|
|
13
13
|
if character != ""
|
|
14
14
|
self.character=(character)
|
|
15
15
|
else
|
|
16
|
-
@@
|
|
16
|
+
@@dialogue_quotes << self
|
|
17
17
|
end
|
|
18
18
|
@@all << self
|
|
19
19
|
end
|
|
@@ -49,10 +49,10 @@ class Quote
|
|
|
49
49
|
character
|
|
50
50
|
end
|
|
51
51
|
|
|
52
|
-
def self.
|
|
53
|
-
n = @@
|
|
52
|
+
def self.get_dialogue
|
|
53
|
+
n = @@dialogue_quotes.size - 1
|
|
54
54
|
r = rand(0..n)
|
|
55
|
-
puts "#{@@
|
|
55
|
+
puts "#{@@dialogue_quotes[r].content}"
|
|
56
56
|
end
|
|
57
57
|
|
|
58
58
|
def self.get_random
|