Module: CouchPotato::View::CustomViews::ClassMethods
- Defined in:
- lib/couch_potato/view/custom_views.rb
Instance Method Summary collapse
-
#view(view_name, options) ⇒ Object
declare a couchdb view, for examples on how to use see the *ViewSpec classes in CouchPotato::View.
Instance Method Details
#view(view_name, options) ⇒ Object
declare a couchdb view, for examples on how to use see the *ViewSpec classes in CouchPotato::View
19 20 21 22 23 24 25 26 |
# File 'lib/couch_potato/view/custom_views.rb', line 19 def view(view_name, ) self.class.instance_eval do define_method view_name do |view_parameters = {}| klass = [:type] ? [:type].to_s.camelize : 'Model' CouchPotato::View.const_get("#{klass}ViewSpec").new self, view_name, , view_parameters end end end |