Class: OpenXml::Docx::Elements::Element
- Inherits:
-
Object
- Object
- OpenXml::Docx::Elements::Element
show all
- Includes:
- AttributeBuilder
- Defined in:
- lib/openxml/docx/elements/element.rb
Direct Known Subclasses
AbsolutePositionTab, Break, CarriageReturn, Container, ContentPart, Control, Dirty, LastRenderedPageBreak, LongDay, LongMonth, LongYear, NonbreakingHyphen, OptionalHyphen, PageNumber, ShortDay, ShortMonth, ShortYear, Symbol, Tab, Text
Constant Summary
AttributeBuilder::VALID_THEME_COLORS, AttributeBuilder::VALID_TYPES
Class Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
#attributes, included, #render?
Class Attribute Details
.property_name ⇒ Object
Returns the value of attribute property_name.
8
9
10
|
# File 'lib/openxml/docx/elements/element.rb', line 8
def property_name
@property_name
end
|
Class Method Details
.name(*args) ⇒ Object
15
16
17
18
|
# File 'lib/openxml/docx/elements/element.rb', line 15
def name(*args)
@property_name = args.first if args.any?
@name
end
|
.namespace(*args) ⇒ Object
20
21
22
23
|
# File 'lib/openxml/docx/elements/element.rb', line 20
def namespace(*args)
@namespace = args.first if args.any?
@namespace
end
|
.tag(*args) ⇒ Object
10
11
12
13
|
# File 'lib/openxml/docx/elements/element.rb', line 10
def tag(*args)
@tag = args.first if args.any?
@tag
end
|
Instance Method Details
#name ⇒ Object
31
32
33
|
# File 'lib/openxml/docx/elements/element.rb', line 31
def name
self.class.property_name || default_name
end
|
#namespace ⇒ Object
35
36
37
|
# File 'lib/openxml/docx/elements/element.rb', line 35
def namespace
self.class.namespace || default_namespace
end
|
#tag ⇒ Object
27
28
29
|
# File 'lib/openxml/docx/elements/element.rb', line 27
def tag
self.class.tag || default_tag
end
|
#to_xml(xml) ⇒ Object
39
40
41
|
# File 'lib/openxml/docx/elements/element.rb', line 39
def to_xml(xml)
xml["w"].public_send(tag, xml_attributes)
end
|