Sha256: befaddacf61bceb4e5c6d4cec1a94f3d2e29313e3981fb73f093c1c58ab1a944
Contents?: true
Size: 464 Bytes
Versions: 9
Compression:
Stored size: 464 Bytes
Contents
module Garb class Account attr_reader :id, :name, :profiles def initialize(profiles) @id = profiles.first.account_id @name = profiles.first.account_name @profiles = profiles end def self.all(session = Session) profiles = {} Profile.all(session).each do |profile| (profiles[profile.account_id] ||= []) << profile end profiles.map {|k,v| v}.map {|profiles| new(profiles)} end end end
Version data entries
9 entries across 9 versions & 2 rubygems