Class: PrintReleaf::Account
Instance Attribute Summary
Attributes inherited from Resource
#copy, #owner
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Resource
action, actions, #changes, #compact_inspect, #delete, #deleted?, #find, #initialize, #inspect, path, #reset, #to_s, uri
Class Method Details
.mine ⇒ Object
34
35
36
37
|
# File 'lib/printreleaf/account.rb', line 34
def self.mine
response = PrintReleaf.get("/account")
self.new(response)
end
|
Instance Method Details
#accounts ⇒ Object
65
66
67
|
# File 'lib/printreleaf/account.rb', line 65
def accounts
@accounts ||= Relation.new(self, Account)
end
|
#active? ⇒ Boolean
47
48
49
|
# File 'lib/printreleaf/account.rb', line 47
def active?
status == "active"
end
|
#certificates ⇒ Object
69
70
71
|
# File 'lib/printreleaf/account.rb', line 69
def certificates
@certificates ||= Relation.new(self, Certificate)
end
|
#children ⇒ Object
61
62
63
|
# File 'lib/printreleaf/account.rb', line 61
def children
accounts
end
|
#deposits ⇒ Object
73
74
75
|
# File 'lib/printreleaf/account.rb', line 73
def deposits
@deposits ||= Relation.new(self, Deposit)
end
|
#feeds ⇒ Object
77
78
79
|
# File 'lib/printreleaf/account.rb', line 77
def feeds
@feeds ||= Relation.new(self, Feed)
end
|
#inactive? ⇒ Boolean
51
52
53
|
# File 'lib/printreleaf/account.rb', line 51
def inactive?
status == "inactive"
end
|
#invitations ⇒ Object
81
82
83
|
# File 'lib/printreleaf/account.rb', line 81
def invitations
@invitations ||= Relation.new(self, Invitation)
end
|
#parent ⇒ Object
55
56
57
58
|
# File 'lib/printreleaf/account.rb', line 55
def parent
return nil if parent_id.nil?
@parent ||= Account.find(parent_id)
end
|
#servers ⇒ Object
85
86
87
|
# File 'lib/printreleaf/account.rb', line 85
def servers
@servers ||= Relation.new(self, Server)
end
|
#transactions ⇒ Object
89
90
91
|
# File 'lib/printreleaf/account.rb', line 89
def transactions
@transactions ||= Relation.new(self, Transaction)
end
|
#uri ⇒ Object
Account URI is always root, even when it has an owner.
/accounts/456
Instead of:
/accounts/123/accounts/456
43
44
45
|
# File 'lib/printreleaf/account.rb', line 43
def uri
Util.join_uri(self.class.uri, self.id)
end
|
#users ⇒ Object
93
94
95
|
# File 'lib/printreleaf/account.rb', line 93
def users
@users ||= Relation.new(self, User)
end
|