Module: Venduitz::Grape
- Defined in:
- lib/venduitz/grape.rb
Class Method Summary collapse
-
.call(object, env) ⇒ Object
Call method.
Class Method Details
.call(object, env) ⇒ Object
Call method
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/venduitz/grape.rb', line 6 def self.call(object, env) # Route Options = env['api.endpoint']..fetch :route_options, {} # Must define the Representer in the endpoint raise 'Must define the Venduitz in the endpoind' if [:venduitz].nil? # Vendtuiz options = [:venduitz_options].nil? ? {} : [:venduitz_options] # Representer options [:exclude] ||= [] # Define the Cache options [:cache] ||= Venduitz::Cache.enabled [:cache_options] ||= Venduitz::Cache.config # Render it! [:venduitz].to_json object, [:exclude], [:cache], [:cache_options] end |