Sha256: 345ae86f82caa31116b9e8de2063fa3b0c2fb361c05ee8ae6ba2a1e58992af81
Contents?: true
Size: 651 Bytes
Versions: 14
Compression:
Stored size: 651 Bytes
Contents
module Access module MuchMeta def set_up_methods(values) self.class.class_eval do if Access.config.access_used_fields == 'true' attr_reader :used_fields values.keys.each do |key| define_method(key.to_sym) do @used_fields << key.to_sym instance_variable_get("@#{key.to_sym}") end end else attr_reader(*values.keys) end end end def set_values(values) values.each do |attribute_name, attribute_value| self.instance_variable_set("@#{attribute_name}", attribute_value) end end end end
Version data entries
14 entries across 14 versions & 1 rubygems