Class: Ti::Config
- Inherits:
-
Object
- Object
- Ti::Config
- Defined in:
- lib/ti/config.rb
Instance Attribute Summary collapse
-
#copyright ⇒ Object
Returns the value of attribute copyright.
-
#description ⇒ Object
Returns the value of attribute description.
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#publisher ⇒ Object
Returns the value of attribute publisher.
-
#url ⇒ Object
Returns the value of attribute url.
-
#version ⇒ Object
Returns the value of attribute version.
Instance Method Summary collapse
Instance Attribute Details
#copyright ⇒ Object
Returns the value of attribute copyright.
5 6 7 |
# File 'lib/ti/config.rb', line 5 def copyright @copyright end |
#description ⇒ Object
Returns the value of attribute description.
5 6 7 |
# File 'lib/ti/config.rb', line 5 def description @description end |
#id ⇒ Object
Returns the value of attribute id.
5 6 7 |
# File 'lib/ti/config.rb', line 5 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/ti/config.rb', line 5 def name @name end |
#publisher ⇒ Object
Returns the value of attribute publisher.
5 6 7 |
# File 'lib/ti/config.rb', line 5 def publisher @publisher end |
#url ⇒ Object
Returns the value of attribute url.
5 6 7 |
# File 'lib/ti/config.rb', line 5 def url @url end |
#version ⇒ Object
Returns the value of attribute version.
5 6 7 |
# File 'lib/ti/config.rb', line 5 def version @version end |
Instance Method Details
#parse(filename) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/ti/config.rb', line 7 def parse(filename) xml = File.open(filename) doc = Nokogiri::XML(xml) xml.close # parse into properties @id = doc.xpath('ti:app/id').text @name = doc.xpath('ti:app/name').text @version = doc.xpath('ti:app/version').text @publisher = doc.xpath('ti:app/publisher').text @url = doc.xpath('ti:app/url').text @description = doc.xpath('ti:app/description').text @copyright = doc.xpath('ti:app/copyright').text end |