Sha256: 609d2614ba29ee27b2014aa32f3fad407a4408f654542d9070e5c83d6ca34955
Contents?: true
Size: 641 Bytes
Versions: 7
Compression:
Stored size: 641 Bytes
Contents
require 'active_model' module Reviewed class Base include ::Reviewed::Embeddable extend ::ActiveModel::Naming attr_accessor :attributes def initialize(data) self.attributes = objectify(data) end class << self def path @resource_name ||= association_name end def association_name self.name.demodulize.downcase.pluralize end end def initialize(data) self.attributes = objectify(data) end def method_missing(sym, *args, &block) if @attributes.has_key?(sym) @attributes[sym] else super end end end end
Version data entries
7 entries across 7 versions & 1 rubygems