Sha256: 4a8745637c9cccedd4433283ebc8fb72ddd573bc53548be0b408be923655d4ff
Contents?: true
Size: 495 Bytes
Versions: 12
Compression:
Stored size: 495 Bytes
Contents
# Provides a method create_store_store_accessors! to make keys fields # accessible in @store module NSConnector::FieldStore # Given fields of ['name'], we want to define a name= and a name # method to retrieve and set the key 'name' in our @store def create_store_accessors! fields.each do |field| self.class.class_eval do define_method field do @store[field.to_s] end define_method "#{field}=" do |value| @store[field.to_s] = value end end end end end
Version data entries
12 entries across 12 versions & 1 rubygems