lib/coder_wally/builder.rb in coder_wally-0.1.2 vs lib/coder_wally/builder.rb in coder_wally-1.0.0
- old
+ new
@@ -20,18 +20,18 @@
Account.new(accounts) if accounts
end
# parse user information from data
def parse_user(data)
- User.new(data)
+ badges = parse_badges(data['badges'])
+ accounts = parse_accounts(data['accounts'])
+ User.new(data, badges, accounts)
end
# build CoderWall object from API response
def build(response)
- badges = parse_badges(response['badges'])
- accounts = parse_accounts(response['accounts'])
user = parse_user(response)
- CoderWall.new badges, user, accounts
+ CoderWall.new user
end
end
end