Top Level Namespace
Defined Under Namespace
Classes: CribDeck, CribbageDeck, Crystel, Deck, EukerDeck, ExplodingDeck, Integer, Object, String
Instance Method Summary
collapse
Instance Method Details
#expect(yesOrNo, test_name = "Test", raise_error = false) ⇒ Object
142
143
144
145
|
# File 'lib/crystel.rb', line 142
def expect(yesOrNo, test_name="Test", raise_error=false)
puts "#{test_name} Passed: #{yesOrNo}" if yesOrNo
raise RuntimeError, "Failed test: #{test_name}" if not yesOrNo and raise_error
end
|
#range(num1, num2 = 0) ⇒ Object
152
153
154
155
156
157
158
|
# File 'lib/crystel.rb', line 152
def range(num1, num2=0)
if num2 == 0
0...num1
else
num1...num2
end
end
|
147
148
149
150
|
# File 'lib/crystel.rb', line 147
def raw_input(prompt)
print prompt
gets.chomp
end
|