entasis 0.3.0.pre1 → 0.3.0.rc1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -1
- data/lib/entasis/model.rb +1 -1
- data/lib/entasis/version.rb +1 -1
- metadata +1 -1
data/README.md
CHANGED
@@ -16,7 +16,7 @@ class Person
|
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
|
-
hilda = Person.new(:
|
19
|
+
hilda = Person.new(name: 'Hilda', age: '23', city: 'Berlin')
|
20
20
|
hilda.attribute_names # => ["name", "age", "city"]
|
21
21
|
hilda.attributes # => {"name"=>"Hilda", "age"=>23, "city"=>"Berlin"}
|
22
22
|
|
data/lib/entasis/model.rb
CHANGED
@@ -28,7 +28,7 @@ module Entasis
|
|
28
28
|
|
29
29
|
def attributes=(hash)
|
30
30
|
hash.each do |name, value|
|
31
|
-
if attribute_names.include?(name.to_s) || self.respond_to?(name)
|
31
|
+
if attribute_names.include?(name.to_s) || self.respond_to?("#{name}=")
|
32
32
|
self.send("#{name}=", value)
|
33
33
|
else
|
34
34
|
raise self.class::UnknownAttributeError, "unkown attribute \"#{name}\""
|
data/lib/entasis/version.rb
CHANGED