dbc-ruby 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/dbc/dbc_object.rb +3 -3
- data/lib/dbc-ruby/version.rb +1 -1
- metadata +1 -1
data/lib/dbc/dbc_object.rb
CHANGED
@@ -3,6 +3,7 @@ module DBC
|
|
3
3
|
def initialize(attributes)
|
4
4
|
attributes.each do |key, value|
|
5
5
|
instance_variable_set("@#{key}", value)
|
6
|
+
self.class.send(:define_method, key){ value }
|
6
7
|
end
|
7
8
|
end
|
8
9
|
|
@@ -23,14 +24,13 @@ module DBC
|
|
23
24
|
private
|
24
25
|
|
25
26
|
def self.create_dbc_objects(api_response)
|
26
|
-
api_response.values.first.map
|
27
|
+
api_response.values.first.map do |object|
|
27
28
|
self.new(object)
|
28
29
|
end
|
29
|
-
api_response
|
30
30
|
end
|
31
31
|
|
32
32
|
def self.create_dbc_object(api_response)
|
33
|
-
|
33
|
+
self.new(api_response.values.first)
|
34
34
|
end
|
35
35
|
end
|
36
36
|
end
|
data/lib/dbc-ruby/version.rb
CHANGED