Class: Licensario::LicensedFeature
- Defined in:
- lib/licensario/licensed_feature.rb
Instance Attribute Summary collapse
-
#amount_used ⇒ Object
Returns the value of attribute amount_used.
-
#id ⇒ Object
Returns the value of attribute id.
-
#total_amount ⇒ Object
Returns the value of attribute total_amount.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ LicensedFeature
constructor
A new instance of LicensedFeature.
Methods inherited from Base
api, date_format, establish_connection
Constructor Details
#initialize(attributes = {}) ⇒ LicensedFeature
Returns a new instance of LicensedFeature.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/licensario/licensed_feature.rb', line 8 def initialize(attributes = {}) if attributes[:xml_node] or attributes[:xml] xml_node = attributes[:xml_node] ? attributes[:xml_node] : Nokogiri::XML(attributes[:xml]).xpath("//feature")[0] xml_attrs = xml_node.attributes { id: 'id', total_amount: 'totalAmount', amount_used: 'amountUsed' }.each do |k,v| attributes[k] = xml_attrs[v] ? xml_attrs[v].value : nil end attributes.delete(:xml_node) attributes.delete(:xml) end super(attributes) end |
Instance Attribute Details
#amount_used ⇒ Object
Returns the value of attribute amount_used.
6 7 8 |
# File 'lib/licensario/licensed_feature.rb', line 6 def amount_used @amount_used end |
#id ⇒ Object
Returns the value of attribute id.
6 7 8 |
# File 'lib/licensario/licensed_feature.rb', line 6 def id @id end |
#total_amount ⇒ Object
Returns the value of attribute total_amount.
6 7 8 |
# File 'lib/licensario/licensed_feature.rb', line 6 def total_amount @total_amount end |