The code powering m.abunchtell.com https://m.abunchtell.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

11 lines
235 B

  1. # frozen_string_literal: true
  2. class HashObject
  3. def initialize(hash)
  4. hash.each do |k, v|
  5. instance_variable_set("@#{k}", v)
  6. self.class.send(:define_method, k, proc { instance_variable_get("@#{k}") })
  7. end
  8. end
  9. end