lib/coder_wally/user.rb in coder_wally-0.1.2 vs lib/coder_wally/user.rb in coder_wally-1.0.0
- old
+ new
@@ -1,17 +1,21 @@
# All code in the gem is namespaced under this module.
module CoderWally
# Stores user properties
class User
# Object properties
- attr_reader :name, :username, :location, :team, :endorsements
+ attr_reader :badges, :accounts, :details
# Initialise object with a hash of values
- def initialize(data)
- @name = data['name']
- @username = data['username']
- @location = data['location']
- @team = data['team']
- @endorsements = data['endorsements']
+ def initialize(data, badges, accounts)
+ @badges = badges
+ @accounts = accounts
+ @details = {
+ name: data['name'],
+ username: data['username'],
+ location: data['location'],
+ team: data['team'],
+ endorsements: data['endorsements']
+ }
end
end
end