Class: Gobbler::Quota

Inherits:
Base
  • Object
show all
Defined in:
lib/gobbler/quota.rb

Instance Attribute Summary

Attributes inherited from Base

#json

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#base_attr, #initialize

Constructor Details

This class inherits a constructor from Gobbler::Base

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Gobbler::Base

Class Method Details

.getQuota

Returns The transfer and storage quota for your account.

Returns:

  • (Quota)

    The transfer and storage quota for your account



9
10
11
# File 'lib/gobbler/quota.rb', line 9

def self.get
  new(::Gobbler.request("v1/quotas"))
end

Instance Method Details

#storageInteger

Returns The total bytes you can backup (note -1 represents unlimted).

Returns:

  • (Integer)

    The total bytes you can backup (note -1 represents unlimted)



24
25
26
# File 'lib/gobbler/quota.rb', line 24

def storage
  quotas["limits"]["storage"]
end

#transferInteger

Returns The total bytes you can sending (note -1 represents unlimted).

Returns:

  • (Integer)

    The total bytes you can sending (note -1 represents unlimted)



14
15
16
# File 'lib/gobbler/quota.rb', line 14

def transfer
  quotas["limits"]["transfer"]
end

#unlimited_transfer?Boolean

Returns If your account has unlimited sending.

Returns:

  • (Boolean)

    If your account has unlimited sending



19
20
21
# File 'lib/gobbler/quota.rb', line 19

def unlimited_transfer?
  transfer == -1
end