Module: RMathGuard::Operators
Constant Summary collapse
- PLUS =
make_plus
- MINUS =
make_minus
- EQUALS =
make_equals
- @@rows =
5
- @@columns =
3
Instance Method Summary collapse
- #make_equals ⇒ Object
- #make_minus ⇒ Object
- #make_plus ⇒ Object
- #resize(rows = 3, columns = 5) ⇒ Object
Instance Method Details
#make_equals ⇒ Object
134 135 136 137 138 139 |
# File 'lib/rmathguard/number.rb', line 134 def make_equals Digit.build(@@rows, @@columns) do full_row(middle - 1) full_row(middle + 1) end end |
#make_minus ⇒ Object
121 122 123 124 125 |
# File 'lib/rmathguard/number.rb', line 121 def make_minus Digit.build(@@rows, @@columns) do full_row :middle end end |
#make_plus ⇒ Object
127 128 129 130 131 132 |
# File 'lib/rmathguard/number.rb', line 127 def make_plus Digit.build(@@rows, @@columns) do full_row :middle column(middle_column, 1..(self.size - 2)) end end |
#resize(rows = 3, columns = 5) ⇒ Object
112 113 114 115 116 117 118 119 |
# File 'lib/rmathguard/number.rb', line 112 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 |