Sha256: c02c2fe2f3aec245ee0e5c53e2b5e3dfd2b41265c18b45e654cba1c1106dffac
Contents?: true
Size: 845 Bytes
Versions: 1
Compression:
Stored size: 845 Bytes
Contents
module CoderWally # Builds the CoderWall object from the response class Builder # Instantiate class def initialize end # parse badges from data def parse_badges(data) data['badges'].map { |badge| Badge.new(badge) } if data['badges'] end # parse account information from data def parse_accounts(data) Account.new(data['accounts']) if data['accounts'] end # parse user information from data def parse_user(data) User.new(data['name'], data['username'], data['location'], data['team'], data['endorsements']) end # build CoderWall object from API response def build(response) badges = parse_badges(response) accounts = parse_accounts(response) user = parse_user(response) CoderWall.new badges, user, accounts end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
coder_wally-0.1.1 | lib/coder_wally/builder.rb |