Class: Vzaar::AccountType

Inherits:
Object
  • Object
show all
Defined in:
lib/vzaar/account_type.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(xml) ⇒ AccountType

Returns a new instance of AccountType.



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/vzaar/account_type.rb', line 8

def initialize(xml)
  @xml = xml
  doc = REXML::Document.new xml
  @version = doc.elements['account/version'] ?
    doc.elements['account/version'].text : ''
  @id = doc.elements['account/account_id'] ?
    doc.elements['account/account_id'].text : ''
  @title = doc.elements['account/title'] ?
    doc.elements['account/title'].text : ''
  @monthly = doc.elements['account/cost/monthly'] ?
    doc.elements['account/cost/monthly'].text : ''
  @currency = doc.elements['account/cost/currency'] ?
    doc.elements['account/cost/currency'].text : ''
  @bandwidth = doc.elements['account/bandwidth'] ?
    doc.elements['account/bandwidth'].text : ''
  @borderless = doc.elements['account/rights/borderless'] ?
    doc.elements['account/rights/borderless'].text : ''
  @search_enhancer = doc.elements['account/rights/searchEnhancer'] ?
    doc.elements['account/rights/searchEnhancer'].text : ''
end

Instance Attribute Details

#bandwidthObject

Returns the value of attribute bandwidth.



5
6
7
# File 'lib/vzaar/account_type.rb', line 5

def bandwidth
  @bandwidth
end

#borderlessObject

Returns the value of attribute borderless.



5
6
7
# File 'lib/vzaar/account_type.rb', line 5

def borderless
  @borderless
end

#currencyObject

Returns the value of attribute currency.



5
6
7
# File 'lib/vzaar/account_type.rb', line 5

def currency
  @currency
end

#idObject

Returns the value of attribute id.



5
6
7
# File 'lib/vzaar/account_type.rb', line 5

def id
  @id
end

#monthlyObject

Returns the value of attribute monthly.



5
6
7
# File 'lib/vzaar/account_type.rb', line 5

def monthly
  @monthly
end

#search_enhancerObject

Returns the value of attribute search_enhancer.



5
6
7
# File 'lib/vzaar/account_type.rb', line 5

def search_enhancer
  @search_enhancer
end

#titleObject

Returns the value of attribute title.



5
6
7
# File 'lib/vzaar/account_type.rb', line 5

def title
  @title
end

#versionObject

Returns the value of attribute version.



5
6
7
# File 'lib/vzaar/account_type.rb', line 5

def version
  @version
end

#xmlObject

Returns the value of attribute xml.



5
6
7
# File 'lib/vzaar/account_type.rb', line 5

def xml
  @xml
end