Sha256: ab5909659bf2be58954ff730d323584910ac48898c6c500163f1f5f8cab7b442
Contents?: true
Size: 761 Bytes
Versions: 32
Compression:
Stored size: 761 Bytes
Contents
module Faceted module Interface include Faceted::HasObject # Class methods =========================================================== def self.included(base) base.extend ActiveModel::Naming base.extend ClassMethods base.extend Faceted::Model::ModelClassMethods base.send(:attr_accessor, :id) base.send(:attr_accessor, :errors) end module ClassMethods def klass @wraps end def wraps(name, args={}) class_name = args[:class_name] || name.to_s.classify @wraps = eval(class_name) define_method :"#{class_name.downcase}" do object end end def where(args) materialize(klass.where(args)) end end end end
Version data entries
32 entries across 32 versions & 1 rubygems