Class: NVX::SDS::AccountFeatureUsage
- Inherits:
-
Object
- Object
- NVX::SDS::AccountFeatureUsage
- Defined in:
- lib/nvx/sds/APIClasses/accountfeatureusage.rb
Overview
Overview
AccountFeatureUsage is a class to define feature usage. This lets you get usage for a particular account.
There are several usage types such as:
-
Storage Amount
-
Download Bandwidth Amount
-
Upload Bandwidth Amount
Instance Method Summary collapse
-
#feature_name ⇒ Object
Returns the name of the feature.
-
#initialize(element) ⇒ AccountFeatureUsage
constructor
Extracts the Usage information from the xml node element.
-
#to_s ⇒ Object
Returns a nicely formatted feature name : usage amount string.
-
#total_usage_amount ⇒ Object
Returns the total amount of usage.
-
#usage_end_date ⇒ Object
Returns the end date when this usage information applies.
-
#usage_start_date ⇒ Object
Returns the start date when this usage information applies.
Constructor Details
#initialize(element) ⇒ AccountFeatureUsage
Extracts the Usage information from the xml node element.
27 28 29 30 31 32 |
# File 'lib/nvx/sds/APIClasses/accountfeatureusage.rb', line 27 def initialize(element) @feature_name = (text = element.elements["FeatureName"].get_text and text.value) @total_usage_amount = (text = element.elements["TotalUsageAmount"].get_text and text.value) @usage_start_date = (text = element.elements["UsageStartDate"].get_text and text.value) @usage_end_date = (text = element.elements["UsageEndDate"].get_text and text.value) end |
Instance Method Details
#feature_name ⇒ Object
Returns the name of the feature.
40 41 42 |
# File 'lib/nvx/sds/APIClasses/accountfeatureusage.rb', line 40 def feature_name @feature_name end |
#to_s ⇒ Object
Returns a nicely formatted feature name : usage amount string. Eg. “Storage Amount: 10000”
35 36 37 |
# File 'lib/nvx/sds/APIClasses/accountfeatureusage.rb', line 35 def to_s @feature_name + ":" + @total_usage_amount end |
#total_usage_amount ⇒ Object
Returns the total amount of usage.
45 46 47 |
# File 'lib/nvx/sds/APIClasses/accountfeatureusage.rb', line 45 def total_usage_amount @total_usage_amount end |
#usage_end_date ⇒ Object
Returns the end date when this usage information applies.
55 56 57 |
# File 'lib/nvx/sds/APIClasses/accountfeatureusage.rb', line 55 def usage_end_date @usage_end_date end |
#usage_start_date ⇒ Object
Returns the start date when this usage information applies.
50 51 52 |
# File 'lib/nvx/sds/APIClasses/accountfeatureusage.rb', line 50 def usage_start_date @usage_start_date end |