Class: Xommelier::Xml::Element
- Inherits:
-
Object
- Object
- Xommelier::Xml::Element
- Includes:
- Namespace, Serialization, Structure
- Defined in:
- lib/xommelier/xml.rb,
lib/xommelier/xml/element.rb,
lib/xommelier/xml/element/namespace.rb,
lib/xommelier/xml/element/structure.rb,
lib/xommelier/xml/element/serialization.rb,
lib/xommelier/xml/element/structure/property.rb
Direct Known Subclasses
Atom::Category, Atom::Content, Atom::Entry, Atom::Feed, Atom::Generator, Atom::History::Archive, Atom::History::Complete, Atom::Link, Atom::Person, Atom::Source, Atom::Threading::InReplyTo, DS::Element, OPML::Element, OpenSearch::Element, RSS::Element, Sitemap::Element
Defined Under Namespace
Modules: Namespace, Serialization, Structure
Constant Summary
Constants included from Serialization
Serialization::SAVE_OPTIONS, Serialization::SERIALIZATION_OPTIONS
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
Attributes included from Namespace
Instance Method Summary collapse
-
#initialize(contents = {}, options = {}) ⇒ Element
constructor
A new instance of Element.
- #inspect ⇒ Object
Methods included from Serialization
#<=>, #==, #=~, #from_xml, #to_hash, #to_nokogiri, #to_s, #to_xml
Methods included from Namespace
Constructor Details
#initialize(contents = {}, options = {}) ⇒ Element
Returns a new instance of Element.
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/xommelier/xml/element.rb', line 26 def initialize(contents = {}, = {}) self. = @elements = {} @attributes = {} @text = nil @errors = [] set_default_values case contents when Hash contents.each do |name, value| send("#{name}=", value) end else send(:text=, contents) end end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
24 25 26 |
# File 'lib/xommelier/xml/element.rb', line 24 def @options end |
Instance Method Details
#inspect ⇒ Object
53 54 55 |
# File 'lib/xommelier/xml/element.rb', line 53 def inspect %(#<#{self.class.name}:0x#{object_id.to_s(16)} #{inspect_contents}>) end |