Sha256: e2cbe6b18a7e70bd6191711804bb6cbcecf1f769fc119d3c7b51cacaea29fbec
Contents?: true
Size: 523 Bytes
Versions: 23
Compression:
Stored size: 523 Bytes
Contents
module G5Updatable::FirstClassProperties extend ActiveSupport::Concern included do after_initialize :define_methods_for_properties end def properties=(hash) write_attribute("properties", hash) define_methods_for_properties end protected def define_methods_for_properties return unless properties.present? properties.each do |key, value| next if respond_to?(key) define_singleton_method(key) do properties[key.to_s] if properties.present? end end end end
Version data entries
23 entries across 23 versions & 1 rubygems