Class: Internode::Usage
Instance Attribute Summary
Attributes inherited from Resource
#client, #path
Instance Method Summary
collapse
Methods inherited from Resource
#content, content_attr, #initialize
Instance Method Details
#id ⇒ Object
3
4
5
|
# File 'lib/internode/usage.rb', line 3
def id
service.text
end
|
#percentage ⇒ Object
43
44
45
|
# File 'lib/internode/usage.rb', line 43
def percentage
total.to_f / quota.to_f * 100.0
end
|
#plan_interval ⇒ Object
27
28
29
|
# File 'lib/internode/usage.rb', line 27
def plan_interval
traffic.attr("plan-interval").text
end
|
#quota ⇒ Object
31
32
33
|
# File 'lib/internode/usage.rb', line 31
def quota
traffic.attr("quota").text.to_i
end
|
#quota_gb ⇒ Object
39
40
41
|
# File 'lib/internode/usage.rb', line 39
def quota_gb
quota_mb / 1000
end
|
#quota_mb ⇒ Object
35
36
37
|
# File 'lib/internode/usage.rb', line 35
def quota_mb
quota / 1000 / 1000
end
|
#rollover ⇒ Object
23
24
25
|
# File 'lib/internode/usage.rb', line 23
def rollover
traffic.attr("rollover").text
end
|
#total ⇒ Object
11
12
13
|
# File 'lib/internode/usage.rb', line 11
def total
traffic.text.to_i
end
|
#total_gb ⇒ Object
19
20
21
|
# File 'lib/internode/usage.rb', line 19
def total_gb
total_mb / 1000
end
|
#total_mb ⇒ Object
15
16
17
|
# File 'lib/internode/usage.rb', line 15
def total_mb
total / 1000 / 1000
end
|
#type ⇒ Object
7
8
9
|
# File 'lib/internode/usage.rb', line 7
def type
service.attr("type").text
end
|