nagare 1.2.0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/nagare.rb +16 -2
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0539766dcdb5d45a8bec091184fbaca8c96af476
|
4
|
+
data.tar.gz: 0550a8513b31249a51d8014faf93a152750198a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 320f025f77101f9663063008d87f4ba98e69293d6f8b531be253c422eea363628f34b9ddee9f5ae299987df6057425c35180af18fa0439769476c817744666bc
|
7
|
+
data.tar.gz: d1e05d1290f20fb0967dd64736e4f3d9480c5198c97e9435c31dcb8c06b7ff5a393d14ec6b29d8924eb1f4a66322b32792eb2d15ac168569041d144bd81d5f34
|
data/lib/nagare.rb
CHANGED
@@ -27,16 +27,30 @@ module Nagare
|
|
27
27
|
super
|
28
28
|
end
|
29
29
|
|
30
|
+
def self._options
|
31
|
+
@options ||= {}
|
32
|
+
end
|
33
|
+
|
34
|
+
def self.options(options)
|
35
|
+
@options = options
|
36
|
+
end
|
37
|
+
|
30
38
|
def initialize(object, context)
|
31
39
|
@object = object
|
32
40
|
@context = context
|
33
41
|
end
|
34
42
|
|
35
43
|
def attributes
|
36
|
-
self.class._attributes.inject({}) do |hash, attribute|
|
44
|
+
attributes = self.class._attributes.inject({}) do |hash, attribute|
|
37
45
|
hash[attribute.to_s] = send(attribute)
|
38
46
|
hash
|
39
|
-
end
|
47
|
+
end
|
48
|
+
|
49
|
+
if !self.class._options.fetch(:nil, false)
|
50
|
+
attributes.compact
|
51
|
+
else
|
52
|
+
attributes
|
53
|
+
end
|
40
54
|
end
|
41
55
|
|
42
56
|
def method_missing(key, *args)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nagare
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Oestrich
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-07-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -72,3 +72,4 @@ signing_key:
|
|
72
72
|
specification_version: 4
|
73
73
|
summary: Serialize your ruby objects
|
74
74
|
test_files: []
|
75
|
+
has_rdoc:
|