deploy: ebd4cc0010
This commit is contained in:
21
node_modules/shiki/samples/ruby.sample
generated
vendored
21
node_modules/shiki/samples/ruby.sample
generated
vendored
@@ -1,21 +0,0 @@
|
||||
class LotteryTicket
|
||||
|
||||
NUMERIC_RANGE = 1..25
|
||||
|
||||
attr_reader :picks, :purchased
|
||||
|
||||
def initialize( *picks )
|
||||
if picks.length != 3
|
||||
raise ArgumentError, "three numbers must be picked"
|
||||
elsif picks.uniq.length != 3
|
||||
raise ArgumentError, "the three picks must be different numbers"
|
||||
elsif picks.detect { |p| not NUMERIC_RANGE === p }
|
||||
raise ArgumentError, "the three picks must be numbers between 1 and 25"
|
||||
end
|
||||
@picks = picks
|
||||
@purchased = Time.now
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
# From https://poignant.guide/book/chapter-5.html
|
||||
Reference in New Issue
Block a user