RubyGems Navigation menu

extreml 0.1.0

# Extreml ### Ruby XML manipulation gem A powerful ruby gem to easily manipulate XML documents, that gives acces to the elements through dynamic methods. This library contains another class, TypeElement, which exposes dynamic methods named after its nested tags. The document method in of Extreml returns aTypeElement object with a method named after the root tag which returns the first level of nesting represented as TypeElement objects. Any subsequent object has methods that reflect its structure, that return recursively an object that has the nested elements as methods. If there are more than one element with the same tag, that method will return an array containing all subsequent objects. All basic methods of TypeElement have aliases, in order to prevent method overriding in case the document contains tags with similar names, which are called with two leading underscores (es. __types). Usage: ------ ### Basic methods: **Extreml:** document: returns the representation of the entire document as a TypeElement object. tree: prints the entire structure of the document for debugging purposes. **TypeElement:** name: returns the name of the element (= tag name). namespace: returns the namespace of the tag. attributes: returns an hash with the property names as key and the values as value. types: returns an array containing the names of the dynamic methods referring to the nested elements. to_s: returns the content (overrides tree: prints the structure referred part of the document for debugging purposes. All these methods have aliases (eg. __name, __namespace, etc.) **File example:** funny_people.xml Guybrush Threepwood <address> Scabb Island Pirate's city Voodoo Blvd. 3 </address> Senbei Norimaki <address> Penguin Village Tanuki doro 1 </address> ## Code example: xml = Extreml.new './funny_people.xml' xml.header.version # => "1.0" xml.header.encoding # => "UTF-8" xml.document.funnyPeople.businessCard[0].name.firstName.to_s # => Guybrush xml.document.funnyPeople.businessCard[0].__name # => "businessCard" xml.document.funnyPeople.types # => # xml.document.funnyPeople.__types # => [:businessCard, :types]

Gemfile:
= Copy to clipboard Copied!

install:
=

Versions:

  1. 2.0.0 - June 19, 2020 (8 KB)
  2. 1.0.0 - May 19, 2020 (7.5 KB)
  3. 0.1.4 - May 16, 2020 (7.5 KB)
  4. 0.1.3 - May 09, 2020 (7 KB)
  5. 0.1.2 - May 09, 2020 (7 KB)
  6. 0.1.0 - May 09, 2020 (8 KB)
Show all versions (7 total)

Owners:

Pushed by:

Authors:

  • Fabio Boccacini

SHA 256 checksum:

= Copy to clipboard Copied!

Total downloads 10,839

For this version 1,472

License:

MIT

Required Ruby Version: >= 0

Links: