hash_attribute_assignment 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/hash_attribute_assignment.rb +5 -2
- data/lib/hash_attribute_assignment/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: 8920058fbb6e4ccdb57244d95e8a162dc9aec6fd
|
4
|
+
data.tar.gz: 89b37e57ed9f4ef74b87d24503e44d04280ae519
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1346a6b793259b6f8a6a19812fde7a90f0bc07fbfd08983a53f79ecc41765c9584d64ba031518f0a88f8a781a8799d61299a211b547a8ae648f9b7741613ba23
|
7
|
+
data.tar.gz: af6e74226e703014c1abf12791e3fa3c0dbb7e0c80d4320351f9198d7c29623488fe4b50a4f368e4c2829a022d180b0f8c1a2796f53e1d6f69685700e9fb7d68
|
@@ -18,7 +18,6 @@ module HashAttributeAssignment
|
|
18
18
|
@hash = hash
|
19
19
|
@klass = instance.class
|
20
20
|
@instance = instance
|
21
|
-
@hash_validations = klass.class_variable_get(:@@hash_validations)
|
22
21
|
end
|
23
22
|
|
24
23
|
def assign
|
@@ -30,9 +29,13 @@ module HashAttributeAssignment
|
|
30
29
|
|
31
30
|
private
|
32
31
|
|
33
|
-
attr_reader :klass, :instance
|
32
|
+
attr_reader :klass, :instance
|
34
33
|
attr_accessor :hash
|
35
34
|
|
35
|
+
def hash_validations
|
36
|
+
klass.send(:hash_validations)
|
37
|
+
end
|
38
|
+
|
36
39
|
def assign_asstributes
|
37
40
|
hash.each do |key, value|
|
38
41
|
instance.instance_variable_set("@#{key}".to_sym, value)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hash_attribute_assignment
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Corey Alexander
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-06 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: coreyja@gmail.com
|