Sha256: 2b64c28de68c01a0fbcc52f1001e7292a9d4deb7e43299e446e47418d4948620
Contents?: true
Size: 368 Bytes
Versions: 93
Compression:
Stored size: 368 Bytes
Contents
module Inferno module Entities class Entity def initialize(params, attributes) attributes.each { |name| instance_variable_set("@#{name}", params[name]) } end def to_hash self.class::ATTRIBUTES.each_with_object({}) do |attribute, hash| hash[attribute] = send(attribute) end.compact end end end end
Version data entries
93 entries across 93 versions & 1 rubygems