mirror of
https://framagit.org/tykayn/mastodon.git
synced 2023-08-25 08:33:12 +02:00
11 lines
235 B
Ruby
11 lines
235 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
class HashObject
|
||
|
def initialize(hash)
|
||
|
hash.each do |k, v|
|
||
|
instance_variable_set("@#{k}", v)
|
||
|
self.class.send(:define_method, k, proc { instance_variable_get("@#{k}") })
|
||
|
end
|
||
|
end
|
||
|
end
|