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
32
33
34
35
|
# File 'lib/printreleaf/account.rb', line 32
def self.mine
response = PrintReleaf.get("/account")
self.new(response)
end
|
Instance Method Details
#accounts ⇒ Object
63
64
65
|
# File 'lib/printreleaf/account.rb', line 63
def accounts
@accounts ||= Relation.new(self, Account)
end
|
#active? ⇒ Boolean
45
46
47
|
# File 'lib/printreleaf/account.rb', line 45
def active?
status == "active"
end
|
#certificates ⇒ Object
67
68
69
|
# File 'lib/printreleaf/account.rb', line 67
def certificates
@certificates ||= Relation.new(self, Certificate)
end
|
#children ⇒ Object
59
60
61
|
# File 'lib/printreleaf/account.rb', line 59
def children
accounts
end
|
#deposits ⇒ Object
71
72
73
|
# File 'lib/printreleaf/account.rb', line 71
def deposits
@deposits ||= Relation.new(self, Deposit)
end
|
#feeds ⇒ Object
75
76
77
|
# File 'lib/printreleaf/account.rb', line 75
def feeds
@feeds ||= Relation.new(self, Feed)
end
|
#inactive? ⇒ Boolean
49
50
51
|
# File 'lib/printreleaf/account.rb', line 49
def inactive?
status == "inactive"
end
|
#invitations ⇒ Object
79
80
81
|
# File 'lib/printreleaf/account.rb', line 79
def invitations
@invitations ||= Relation.new(self, Invitation)
end
|
#parent ⇒ Object
53
54
55
56
|
# File 'lib/printreleaf/account.rb', line 53
def parent
return nil if parent_id.nil?
@parent ||= Account.find(parent_id)
end
|
#servers ⇒ Object
83
84
85
|
# File 'lib/printreleaf/account.rb', line 83
def servers
@servers ||= Relation.new(self, Server)
end
|
#transactions ⇒ Object
87
88
89
|
# File 'lib/printreleaf/account.rb', line 87
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
41
42
43
|
# File 'lib/printreleaf/account.rb', line 41
def uri
Util.join_uri(self.class.uri, self.id)
end
|
#users ⇒ Object
91
92
93
|
# File 'lib/printreleaf/account.rb', line 91
def users
@users ||= Relation.new(self, User)
end
|