Class: DLDInternet::DOctl::Account::Command

Inherits:
Thor::Command
  • Object
show all
Defined in:
lib/dldinternet/doctl/account/command.rb

Instance Method Summary collapse

Instance Method Details

#getObject



15
16
17
18
19
20
21
22
# File 'lib/dldinternet/doctl/account/command.rb', line 15

def get()
  command_pre
  @header = ->{ sprintf('%-30s%-14s%-16s%-52s%s', 'Email','Droplet Limit','Email Verified',	'UUID', 'Status') }
  @format = ->(res) { sprintf('%-30s%-14s%-16s%-52s%s', res['email'], res['droplet_limit'], res['email_verified'], res['uuid'], res['status'] ) }
  res = DLDInternet::DOctl::API::Account::Get.new(options, @logger).GetAccount()
  command_out(res)
  0
end

#ratelimitObject



28
29
30
31
32
33
34
35
# File 'lib/dldinternet/doctl/account/command.rb', line 28

def ratelimit()
  command_pre
  @header = -> { sprintf('%-7s%-10s%s', 'Limit','Remaining', 'Reset') }
  @format = ->(res) { sprintf('%-7s%-10s%s', res['ratelimit-limit'], res['ratelimit-remaining'], res['ratelimit-reset'] ) }
  res = DLDInternet::DOctl::API::Account::Ratelimit.new(options, @logger).GetRatelimit()
  command_out(res)
  0
end