Class: Garb::Account

Inherits:
Object
  • Object
show all
Defined in:
lib/garb/account.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(profiles) ⇒ Account

Returns a new instance of Account.



5
6
7
8
9
# File 'lib/garb/account.rb', line 5

def initialize(profiles)
  @id = profiles.first.    
  @name = profiles.first.
  @profiles = profiles
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



3
4
5
# File 'lib/garb/account.rb', line 3

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/garb/account.rb', line 3

def name
  @name
end

#profilesObject (readonly)

Returns the value of attribute profiles.



3
4
5
# File 'lib/garb/account.rb', line 3

def profiles
  @profiles
end

Class Method Details

.allObject



11
12
13
# File 'lib/garb/account.rb', line 11

def self.all
  Profile.all.group_to_array{|p| p.}.map{|profiles| new(profiles)}
end