mitake 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/mitake/model.rb +0 -17
- data/lib/mitake/model/attributes.rb +5 -1
- data/lib/mitake/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 588de0a453cae48483cf27f37c74b2db75e5c5682ed08ac10a3057cd4e478a75
|
4
|
+
data.tar.gz: c338e59a0bcd8df934aae0f52be63c96a7a27bab641efddab5b4758250e1fac8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8b6fa1a4e0e4eee00e87a0f8635ccc57d43a3e8cf09fa43775e1c0313ff0f9043efaa269dcb82cc7c2bb9d64959efc45cde7fd66fac5be63893da9bb16c24947
|
7
|
+
data.tar.gz: c64cc7fe68bd9f0b4734bb865927b9d1ecfae1d9ad34018a6d6d66f372b274eb12f5914014029b1f2ae5d82211869d66dc2be95553cb4ba871cee5ba9332faa1
|
data/Gemfile.lock
CHANGED
data/lib/mitake/model.rb
CHANGED
@@ -18,23 +18,6 @@ module Mitake
|
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
|
-
# Assign attribute by hash
|
22
|
-
#
|
23
|
-
# @see Mitake::Model::Attributes#assign_attributes
|
24
|
-
#
|
25
|
-
# @param attributes [Hash] the attributes to assignment
|
26
|
-
#
|
27
|
-
# @since 0.1.0
|
28
|
-
def assign_attributes(attributes = {})
|
29
|
-
attributes.each do |key, value|
|
30
|
-
next unless self.class.attribute_names.include?(key.to_s)
|
31
|
-
next send("#{key}=", value) if respond_to?("#{key}=")
|
32
|
-
|
33
|
-
type = self.class.attributes[key.to_s]
|
34
|
-
instance_variable_set("@#{key}", self.class.cast(value, type))
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
21
|
# Get attributes as hash
|
39
22
|
#
|
40
23
|
# @return [Hash] the object attributes
|
@@ -18,7 +18,11 @@ module Mitake
|
|
18
18
|
# @since 0.1.0
|
19
19
|
def assign_attributes(attributes = {})
|
20
20
|
attributes.each do |key, value|
|
21
|
-
|
21
|
+
next unless self.class.attribute_names.include?(key.to_s)
|
22
|
+
next send("#{key}=", value) if respond_to?("#{key}=")
|
23
|
+
|
24
|
+
type = self.class.attributes[key.to_s]
|
25
|
+
instance_variable_set("@#{key}", self.class.cast(value, type))
|
22
26
|
end
|
23
27
|
end
|
24
28
|
end
|
data/lib/mitake/version.rb
CHANGED