1
0
mirror of https://github.com/mastodon/mastodon synced 2024-12-15 07:08:29 +09:00
mastodon/app/lib/hash_object.rb

11 lines
235 B
Ruby
Raw Normal View History

# 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