Sha256: da4e07ec1c8e8cc6838024ea3fae8e3dc7592ea9038d66ea9e55fdf1d8260f5e

Contents?: true

Size: 946 Bytes

Versions: 24

Compression:

Stored size: 946 Bytes

Contents

module CouchPotato
  module View
    # A view for custom map/reduce functions that returns the raw data fromcouchdb
    #
    # example:
    #   view :my_custom_view, :map => "function(doc) { emit(doc._id, null); }", :type => :raw, :reduce => nil
    # optionally you can pass in a results filter which you can use to process the raw couchdb results before returning them
    #
    # example:
    #   view :my_custom_view, :map => "function(doc) { emit(doc._id, null); }", :type => :raw, :results_filter => lambda{|results| results['rows].map{|row| row['value']}}
    #
    # example:
    #   view :my_custom_view, :map => "function(doc) { emit(doc._id, null); }", :type => :raw, :lib => {:module => "exports.name = 'module';"
    class RawViewSpec < BaseViewSpec
      def map_function
        options[:map]
      end

      def reduce_function
        options[:reduce]
      end

      def lib
        options[:lib]
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
couch_potato-1.18.0 lib/couch_potato/view/raw_view_spec.rb
couch_potato-1.17.0 lib/couch_potato/view/raw_view_spec.rb
couch_potato-1.16.0 lib/couch_potato/view/raw_view_spec.rb
couch_potato-1.15.0 lib/couch_potato/view/raw_view_spec.rb
couch_potato-1.14.0 lib/couch_potato/view/raw_view_spec.rb
couch_potato-1.13.0 lib/couch_potato/view/raw_view_spec.rb
couch_potato-1.12.1 lib/couch_potato/view/raw_view_spec.rb
couch_potato-1.12.0 lib/couch_potato/view/raw_view_spec.rb
couch_potato-1.11.0 lib/couch_potato/view/raw_view_spec.rb
couch_potato-1.10.1 lib/couch_potato/view/raw_view_spec.rb
couch_potato-1.10.0 lib/couch_potato/view/raw_view_spec.rb
couch_potato-1.9.0 lib/couch_potato/view/raw_view_spec.rb
couch_potato-1.7.1 lib/couch_potato/view/raw_view_spec.rb
couch_potato-1.7.0 lib/couch_potato/view/raw_view_spec.rb
couch_potato-1.6.5 lib/couch_potato/view/raw_view_spec.rb
couch_potato-1.6.4 lib/couch_potato/view/raw_view_spec.rb
couch_potato-1.6.3 lib/couch_potato/view/raw_view_spec.rb
couch_potato-1.4.0 lib/couch_potato/view/raw_view_spec.rb
couch_potato-1.3.0 lib/couch_potato/view/raw_view_spec.rb
couch_potato-1.2.0 lib/couch_potato/view/raw_view_spec.rb