# code-block-pro/1.27.7/build/shiki/samples/ruby.sample

Code Block Pro – Beautiful Syntax Highlighting, version 1.27.7. 21 lines.

- Page: https://pluginprobe.com/plugins/code-block-pro/1.27.7/code/build/shiki/samples/ruby.sample
- Raw: https://pluginprobe.com/plugins/code-block-pro/1.27.7/raw/build/shiki/samples/ruby.sample
- Modified: 2022-08-22T22:25:46+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/code-block-pro/1.27.7/code/build/shiki/samples/ruby.sample#L10-L20`.

```
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
```
