Sha256: 77737a531d990925a5bc20360a8fdbd26065d947b0b5d9c87d4cc736fec840c3
Contents?: true
Size: 593 Bytes
Versions: 14
Compression:
Stored size: 593 Bytes
Contents
module Centaman #:nodoc: class Object def initialize(args = {}) define_variables(args) after_init(args) end def define_variables(args) attributes.each do |attribute| val = args[attribute.centaman_key] attribute.value = val attribute.parse_value self.class.__send__(:attr_accessor, attribute.app_key) instance_variable_set("@#{attribute.app_key}", attribute.value) end end def attributes [] # overwritten by subclasses end def after_init(args) # hook for subclasses end end end
Version data entries
14 entries across 14 versions & 1 rubygems