Class: OpenXml::Builder::Element
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- OpenXml::Builder::Element
- Defined in:
- lib/openxml/builder/element.rb
Instance Attribute Summary collapse
-
#namespace ⇒ Object
Returns the value of attribute namespace.
Instance Method Summary collapse
- #[]=(attribute, value) ⇒ Object
-
#initialize(*args) ⇒ Element
constructor
A new instance of Element.
- #namespaces ⇒ Object (also: #namespace_definitions)
- #namespaces=(ns) ⇒ Object
Constructor Details
#initialize(*args) ⇒ Element
Returns a new instance of Element.
6 7 8 |
# File 'lib/openxml/builder/element.rb', line 6 def initialize(*args) super Ox::Element.new(*args) end |
Instance Attribute Details
#namespace ⇒ Object
Returns the value of attribute namespace.
4 5 6 |
# File 'lib/openxml/builder/element.rb', line 4 def namespace @namespace end |
Instance Method Details
#[]=(attribute, value) ⇒ Object
10 11 12 13 14 |
# File 'lib/openxml/builder/element.rb', line 10 def []=(attribute, value) namespace_def = attribute.downcase.to_s.match(/^xmlns(?:\:(?<prefix>.*))?$/) namespaces << namespace_def[:prefix].to_sym if namespace_def && namespace_def[:prefix] super end |
#namespaces ⇒ Object Also known as: namespace_definitions
26 27 28 |
# File 'lib/openxml/builder/element.rb', line 26 def namespaces @namespaces ||= [] end |
#namespaces=(ns) ⇒ Object
22 23 24 |
# File 'lib/openxml/builder/element.rb', line 22 def namespaces=(ns) @namespaces = Array(ns) end |