Skip to content

Commit

Permalink
Merge pull request #11 from grindars/additional_data
Browse files Browse the repository at this point in the history
Make additional_data available too.
  • Loading branch information
jeanmartin committed Dec 29, 2013
2 parents 3648244 + d84a05a commit 793a5e7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/pipedrive/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,16 @@ class Base < OpenStruct
# @return [CloudApp::Base]
def initialize(attrs = {})
if attrs['data']
super( attrs['data'] )
struct_attrs = attrs['data']

if attrs['additional_data']
struct_attrs.merge!(attrs['additional_data'])
end
else
super(attrs)
struct_attrs = attrs
end

super(struct_attrs)
end

# Updates the object.
Expand Down

0 comments on commit 793a5e7

Please sign in to comment.