Class: Legato::Management::Account

Inherits:
Object
  • Object
show all
Extended by:
Finder
Defined in:
lib/legato/management/account.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Finder

all, base_uri, get, uri_for_user

Constructor Details

#initialize(attributes, user) ⇒ Account

Returns a new instance of Account.



16
17
18
19
20
21
# File 'lib/legato/management/account.rb', line 16

def initialize(attributes, user)
  self.user = user

  self.id = attributes['id'] || attributes[:id]
  self.name = attributes['name'] || attributes[:name]
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



14
15
16
# File 'lib/legato/management/account.rb', line 14

def id
  @id
end

#nameObject

Returns the value of attribute name.



14
15
16
# File 'lib/legato/management/account.rb', line 14

def name
  @name
end

#userObject

Returns the value of attribute user.



14
15
16
# File 'lib/legato/management/account.rb', line 14

def user
  @user
end

Class Method Details

.default_pathObject



6
7
8
# File 'lib/legato/management/account.rb', line 6

def self.default_path
  "/accounts"
end

.from_child(child) ⇒ Object



31
32
33
# File 'lib/legato/management/account.rb', line 31

def self.from_child(child)
  all(child.user).detect {|a| a.id == child.}
end

Instance Method Details

#pathObject



10
11
12
# File 'lib/legato/management/account.rb', line 10

def path
  "/accounts/#{id}"
end

#profilesObject



27
28
29
# File 'lib/legato/management/account.rb', line 27

def profiles
  Profile.(self)
end

#web_propertiesObject



23
24
25
# File 'lib/legato/management/account.rb', line 23

def web_properties
  WebProperty.(self)
end