Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Augments with respond_to block delegating to scope

  • Loading branch information...
commit 85473f4916efe398d71cb9e15a160ad93523f07d 1 parent 34110c5
@nesquena nesquena authored
Showing with 5 additions and 0 deletions.
  1. +5 −0 lib/rabl/engine.rb
View
5 lib/rabl/engine.rb
@@ -149,6 +149,11 @@ def format_json(json_output)
use_callback ? "#{request_params[:callback]}(#{json_output})" : json_output
end
+ # Augments respond to supporting scope methods
+ def respond_to?(name, include_private=false)
+ @_scope.respond_to?(name, include_private) ? true : super
+ end
+
# Supports calling helpers defined for the template scope using method_missing hook
def method_missing(name, *args, &block)
@_scope.respond_to?(name) ? @_scope.send(name, *args, &block) : super
Please sign in to comment.
Something went wrong with that request. Please try again.