class JSONAPIHelpers::ActionDispatchRequestWrapper
NOTE:
For some weird reason, ActiveModelSerializers call #original_url on ActionDispatch::Request, which isn't defined. In order to avoid monkey matching, this wrapper object delegates all methods to the request object and only adds one method #request_url
Attributes
action_dispatch_request[R]
Public Class Methods
new(request)
click to toggle source
Calls superclass method
# File lib/jsonapi_helpers/action_dispatch_request_wrapper.rb, line 12 def initialize(request) super @action_dispatch_request = request end
Public Instance Methods
__getobj__()
click to toggle source
# File lib/jsonapi_helpers/action_dispatch_request_wrapper.rb, line 17 def __getobj__ @action_dispatch_request end
__setobj__(request)
click to toggle source
# File lib/jsonapi_helpers/action_dispatch_request_wrapper.rb, line 21 def __setobj__(request) @action_dispatch_request = request end
request_url()
click to toggle source
# File lib/jsonapi_helpers/action_dispatch_request_wrapper.rb, line 25 def request_url "#{@action_dispatch_request.base_url}#{@action_dispatch_request.path}" end