Module: Grape::EndpointExtension
- Defined in:
- lib/grape-active_model_serializers/endpoint_extension.rb
Instance Attribute Summary collapse
-
#controller_name ⇒ Object
Returns the value of attribute controller_name.
Class Method Summary collapse
Instance Method Summary collapse
- #default_serializer_options ⇒ Object
- #namespace_options ⇒ Object
- #render(resources, meta = {}) ⇒ Object
- #route_options ⇒ Object
- #url_options ⇒ Object
Instance Attribute Details
#controller_name ⇒ Object
Returns the value of attribute controller_name.
9 10 11 |
# File 'lib/grape-active_model_serializers/endpoint_extension.rb', line 9 def controller_name @controller_name end |
Class Method Details
.included(base) ⇒ Object
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/grape-active_model_serializers/endpoint_extension.rb', line 27 def self.included(base) mattr_accessor :_serialization_scope self._serialization_scope = :current_user base.class_eval do def serialization_scope send(_serialization_scope) if _serialization_scope && respond_to?(_serialization_scope, true) end end end |
Instance Method Details
#default_serializer_options ⇒ Object
43 44 |
# File 'lib/grape-active_model_serializers/endpoint_extension.rb', line 43 def end |
#namespace_options ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/grape-active_model_serializers/endpoint_extension.rb', line 11 def if self.respond_to?(:inheritable_setting) inheritable_setting.namespace else settings[:namespace] ? settings[:namespace]. : {} end end |
#render(resources, meta = {}) ⇒ Object
38 39 40 41 |
# File 'lib/grape-active_model_serializers/endpoint_extension.rb', line 38 def render(resources, = {}) env['ams_meta'] = resources end |
#route_options ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/grape-active_model_serializers/endpoint_extension.rb', line 19 def if self.respond_to?(:inheritable_setting) inheritable_setting.route else [:route_options] end end |
#url_options ⇒ Object
46 47 |
# File 'lib/grape-active_model_serializers/endpoint_extension.rb', line 46 def end |