Module: RMathGuard::Numbers
Constant Summary collapse
- ZERO =
make_zero
- ONE =
make_one
- TWO =
make_two
- THREE =
make_three
- FOUR =
make_four
- FIVE =
make_five
- SIX =
make_six
- SEVEN =
make_seven
- EIGHT =
make_eight
- NINE =
make_nine
- @@rows =
5
- @@columns =
3
Instance Method Summary collapse
- #make_eight ⇒ Object
- #make_five ⇒ Object
- #make_four ⇒ Object
- #make_nine ⇒ Object
- #make_one ⇒ Object
- #make_seven ⇒ Object
- #make_six ⇒ Object
- #make_three ⇒ Object
- #make_two ⇒ Object
- #make_zero ⇒ Object
- #resize(rows = 3, columns = 5) ⇒ Object
Instance Method Details
#make_eight ⇒ Object
82 83 84 85 86 |
# File 'lib/rmathguard/number.rb', line 82 def make_eight make_three.build do full_column :first end end |
#make_five ⇒ Object
59 60 61 62 63 64 65 66 67 |
# File 'lib/rmathguard/number.rb', line 59 def make_five Digit.build(@@rows, @@columns) do full_row :top full_row :middle full_row :bottom half_column :top_left half_column :bottom_right end end |
#make_four ⇒ Object
51 52 53 54 55 56 57 |
# File 'lib/rmathguard/number.rb', line 51 def make_four Digit.build(@@rows, @@columns) do half_column :top_left full_row :middle full_column :last end end |
#make_nine ⇒ Object
88 89 90 91 92 |
# File 'lib/rmathguard/number.rb', line 88 def make_nine make_five.build do full_column :last end end |
#make_one ⇒ Object
26 27 28 29 30 |
# File 'lib/rmathguard/number.rb', line 26 def make_one Digit.build(@@rows, @@columns) do full_column :last end end |
#make_seven ⇒ Object
75 76 77 78 79 80 |
# File 'lib/rmathguard/number.rb', line 75 def make_seven Digit.build(@@rows, @@columns) do full_row :top full_column :last end end |
#make_six ⇒ Object
69 70 71 72 73 |
# File 'lib/rmathguard/number.rb', line 69 def make_six make_five.build do full_column :first end end |
#make_three ⇒ Object
42 43 44 45 46 47 48 49 |
# File 'lib/rmathguard/number.rb', line 42 def make_three Digit.build(@@rows, @@columns) do full_row :top full_row :middle full_row :last full_column :last end end |
#make_two ⇒ Object
32 33 34 35 36 37 38 39 40 |
# File 'lib/rmathguard/number.rb', line 32 def make_two Digit.build(@@rows, @@columns) do full_row :top full_row :middle full_row :bottom half_column :top_right half_column :bottom_left end end |
#make_zero ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/rmathguard/number.rb', line 17 def make_zero Digit.build(@@rows, @@columns) do full_row :top full_row :bottom full_column :first full_column :last end end |
#resize(rows = 3, columns = 5) ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'lib/rmathguard/number.rb', line 8 def resize(rows = 3, columns = 5) @@rows = rows @@columns = columns constants.each do |const| remove_const(const) const_set(const, send("make_#{const.downcase}")) end end |