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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: addd6468880c47057a33bd5f69bb77e83256b3f1
4
- data.tar.gz: 181a96b183e625822ccec5a37b6305bb24b0517c
3
+ metadata.gz: 09fc89d897d34e016dd0178202cfcf7efb05b996
4
+ data.tar.gz: b6b27446ce89451319caa15b5f8aa386e0c7d6f9
5
5
  SHA512:
6
- metadata.gz: 94f6c667f3f2f98f7cb37f651c8c9037fdb5e79ea66981b015dda9c15fe6197cc3fbd0391708ef98f19bca497f6ba836e9ead61f5c3328a48b7052484fa91b80
7
- data.tar.gz: 29658eef1f543e440417ee2997eeedffe2b03cfeb7a4ce0b739b912e585dd3b4d5bcf77f1f8ae32971e00224a346aa5b8afe6fcf9fc88f69bc1f0eecb569d741
6
+ metadata.gz: 2089ddfeef6c9d4b018d42a4634a4d2a3b9c9bb23fc40bdb669aae91933deb183703acd7a5c2feaafbdb05faa4c63e778d04dfc89f4fcd25ed1a5a66ef53d883
7
+ data.tar.gz: 04f26407611385c332655415475e7ff012743c208512bb0e4e0772ce72dd3af92f321f65561f2f55759dd0913b0ee621f1fd7dfe5fd4aa93a25e1b8e6e7e19c9
@@ -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
@@ -1,3 +1,3 @@
1
1
  module OceanDynamo
2
- VERSION = "0.2.4"
2
+ VERSION = "0.2.5"
3
3
  end
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
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 00:00:00.000000000 Z
11
+ date: 2013-09-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk