cerulean 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cerulean.rb +3 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0e59127223d322340bed7b946c251e91d6ff40f5
|
4
|
+
data.tar.gz: 2afc6f7147fb46f37c4655acf2880008999292ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 552bb530592c91527815d4e82ffa12cac3b7f6414ca22eadb3e6c0d86e171b2fed1ab965e9b77a1e1c8b5bd2af391e3c7cd8194a1db51b09cdd3595c5d8f0288
|
7
|
+
data.tar.gz: 59d14a6d765f795c7e26c8e9790654c7124b4516b8cd3a2e5203fa8ed9d103d3e524f61083d9beb7379977449343afed8799a622a319f09d847ad1880b0eae96
|
data/lib/cerulean.rb
CHANGED
@@ -60,11 +60,11 @@ module Cerulean
|
|
60
60
|
@declared ||= {} #Hashie::Mash.new(params)
|
61
61
|
end
|
62
62
|
|
63
|
-
def present(object)
|
63
|
+
def present(object, opts={})
|
64
64
|
if object.is_a?(Array) || object.is_a?(ActiveRecord::Relation)
|
65
|
-
render json: object.map { |el| meta[:presenter].new(el).as_json }
|
65
|
+
render json: object.map { |el| meta[:presenter].new(el).as_json(**opts) }
|
66
66
|
else
|
67
|
-
render json: meta[:presenter].new(object).as_json
|
67
|
+
render json: meta[:presenter].new(object).as_json(**opts)
|
68
68
|
end
|
69
69
|
end
|
70
70
|
|