Advertisement
Guest User

Untitled

a guest
Feb 8th, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. def get_element(row, column)
  2. assert(row > 0, "Row cannot be negative.")
  3. assert(column > 0, "Column cannot be negative.")
  4. assert(row < @row_size, "Row out of bounds.")
  5. assert(column < @column_size, "Column out of bounds.")
  6.  
  7. result = @dictionary_of_keys[[row, column]]
  8.  
  9. assert(@dictionary_of_keys[[row, column]].is_a?(Numeric))
  10. end
  11. alias_method :get, :get_element
  12. # alias_method :[], :get_element
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement