logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe git clone https://hacktivis.me/git/mastofe.git

hash_object.rb (235B)


  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