🎉 initiate project *astro_rewrite*
This commit is contained in:
parent
ffd4d5e86c
commit
2ba37bfbe3
8658 changed files with 2268794 additions and 2538 deletions
21
node_modules/shiki/samples/ruby.sample
generated
vendored
Normal file
21
node_modules/shiki/samples/ruby.sample
generated
vendored
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
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
|
||||
Loading…
Add table
Add a link
Reference in a new issue