Class: CouchPotato::View::ModelViewSpec::ErlangGenerator
- Inherits:
-
Object
- Object
- CouchPotato::View::ModelViewSpec::ErlangGenerator
- Defined in:
- lib/couch_potato/view/model_view_spec.rb
Instance Method Summary collapse
-
#initialize(options, klass) ⇒ ErlangGenerator
constructor
A new instance of ErlangGenerator.
- #map_function ⇒ Object
Constructor Details
#initialize(options, klass) ⇒ ErlangGenerator
Returns a new instance of ErlangGenerator.
15 16 17 18 |
# File 'lib/couch_potato/view/model_view_spec.rb', line 15 def initialize(, klass) = @klass = klass end |
Instance Method Details
#map_function ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/couch_potato/view/model_view_spec.rb', line 20 def map_function raise NotImplementedError.new("conditions in Erlang not implemented") if [:conditions] raise NotImplementedError.new("emit_value in Erlang not implemented") if [:emit_value] " fun({Doc}) ->\n case proplists:get_value(<<\"\#{JSON.create_id}\">>, Doc) of\n <<\"\#{@klass.name}\">> ->\n \#{formatted_key},\n Emit(\#{composite_key_brackets emit_key}, 1);\n _ ->\n ok\n end\n end.\n ERL\nend\n" |