Class: Internode::Account
Constant Summary collapse
- PATH =
"/api/v1.5"
Instance Attribute Summary
Attributes inherited from Resource
Instance Method Summary collapse
- #details ⇒ Object
-
#initialize(options = {}) ⇒ Account
constructor
A new instance of Account.
- #services ⇒ Object
- #usage ⇒ Object
Methods inherited from Resource
Constructor Details
#initialize(options = {}) ⇒ Account
Returns a new instance of Account.
5 6 7 8 9 |
# File 'lib/internode/account.rb', line 5 def initialize( = {}) client = .fetch(:client){ Client.new(username: [:username], password: [:password]) } path = .fetch(:path){ PATH } super(client: client, path: path) end |
Instance Method Details
#details ⇒ Object
17 18 19 |
# File 'lib/internode/account.rb', line 17 def details concurrent_map(&:details) end |
#services ⇒ Object
11 12 13 14 15 |
# File 'lib/internode/account.rb', line 11 def services @services ||= content.css("services service").map do |node| Service.new(client: client, path: node.attr("href").text) end end |
#usage ⇒ Object
21 22 23 |
# File 'lib/internode/account.rb', line 21 def usage concurrent_map(&:usage) end |