Module: Faceted::Interface::ClassMethods

Defined in:
lib/faceted/interface.rb

Instance Method Summary collapse

Instance Method Details

#klassObject



19
20
21
# File 'lib/faceted/interface.rb', line 19

def klass
  @wraps
end

#where(args) ⇒ Object



31
32
33
# File 'lib/faceted/interface.rb', line 31

def where(args)
  materialize(klass.where(args))
end

#wraps(name, args = {}) ⇒ Object



23
24
25
26
27
28
29
# File 'lib/faceted/interface.rb', line 23

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