Class: REXMLUtilityNode

Class | REXMLUtilityNode
In: | lib/extlib/hash.rb
Parent: | Object

This is a slighly modified version of the XMLUtilityNode from merb.devjavu.com/projects/merb/ticket/95 (has.sox@gmail.com) It‘s mainly just adding vowels, as I ht cd wth n vwls :) This represents the hard part of the work, all I did was change the underlying parser.

### Methods

add_node inner_html new to_hash to_html to_s translate_xml_entities typecast_value undasherize_keys

### Attributes

attributes | [RW] |
children | [RW] |
name | [RW] |
type | [RW] |

### Public Class methods

new(name, attributes = {})

### Public Instance methods

add_node(node)
inner_html()

Get the inner_html of the REXML node.

to_hash()
to_html()

Converts the node into a readable HTML node.

@return <String> The HTML node in text form.

to_s()

@alias to_html to_s

translate_xml_entities(value)

Convert basic XML entities into their literal values.

@param value<gsub> An XML fragment.

@return <gsub> The XML fragment after converting entities.

typecast_value(value)

Typecasts a value based upon its type. For instance, if `node` has type == "integer", {{[node.typecast_value("12") #=> 12]}}

@param value<String> The value that is being typecast.

@details [:type options]

      "integer"::
        converts +value+ to an integer with #to_i
      "boolean"::
        checks whether +value+, after removing spaces, is the literal
        "true"
      "datetime"::
        Parses +value+ using Time.parse, and returns a UTC Time
      "date"::
        Parses +value+ using Date.parse

@return <Integer, TrueClass, FalseClass, Time, Date, Object>

      The result of typecasting +value+.

@note

      If +self+ does not have a "type" key, or if it's not one of the
      options specified above, the raw +value+ will be returned.

undasherize_keys(params)

Take keys of the form foo-bar and convert them to foo_bar

[Validate]