ocean-dynamo 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ocean-dynamo/schema.rb +15 -0
- data/lib/ocean-dynamo/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 09fc89d897d34e016dd0178202cfcf7efb05b996
|
4
|
+
data.tar.gz: b6b27446ce89451319caa15b5f8aa386e0c7d6f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2089ddfeef6c9d4b018d42a4634a4d2a3b9c9bb23fc40bdb669aae91933deb183703acd7a5c2feaafbdb05faa4c63e778d04dfc89f4fcd25ed1a5a66ef53d883
|
7
|
+
data.tar.gz: 04f26407611385c332655415475e7ff012743c208512bb0e4e0772ce72dd3af92f321f65561f2f55759dd0913b0ee621f1fd7dfe5fd4aa93a25e1b8e6e7e19c9
|
data/lib/ocean-dynamo/schema.rb
CHANGED
@@ -60,9 +60,24 @@ module OceanDynamo
|
|
60
60
|
|
61
61
|
|
62
62
|
def self.attribute(name, type=:string, **pairs)
|
63
|
+
raise DangerousAttributeError, "#{name} is defined by OceanDynamo" if self.dangerous_attributes.include?(name.to_s)
|
63
64
|
attr_accessor name
|
64
65
|
fields[name.to_s] = {type: type, default: pairs[:default]}
|
65
66
|
end
|
66
67
|
|
68
|
+
|
69
|
+
protected
|
70
|
+
|
71
|
+
def self.dangerous_attributes
|
72
|
+
self.public_methods(false).collect do |sym|
|
73
|
+
str = sym.to_s
|
74
|
+
if str.end_with?("?", "=")
|
75
|
+
str[0...-1]
|
76
|
+
else
|
77
|
+
str
|
78
|
+
end
|
79
|
+
end.uniq
|
80
|
+
end
|
81
|
+
|
67
82
|
end
|
68
83
|
end
|
data/lib/ocean-dynamo/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ocean-dynamo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Bengtson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-09-
|
11
|
+
date: 2013-09-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk
|