Class: Rocx::Elements::Element
- Inherits:
-
Object
- Object
- Rocx::Elements::Element
show all
- Includes:
- AttributeBuilder
- Defined in:
- lib/rocx/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.
7
8
9
|
# File 'lib/rocx/elements/element.rb', line 7
def property_name
@property_name
end
|
Class Method Details
.name(*args) ⇒ Object
14
15
16
17
|
# File 'lib/rocx/elements/element.rb', line 14
def name(*args)
@property_name = args.first if args.any?
@name
end
|
.namespace(*args) ⇒ Object
19
20
21
22
|
# File 'lib/rocx/elements/element.rb', line 19
def namespace(*args)
@namespace = args.first if args.any?
@namespace
end
|
.tag(*args) ⇒ Object
9
10
11
12
|
# File 'lib/rocx/elements/element.rb', line 9
def tag(*args)
@tag = args.first if args.any?
@tag
end
|
Instance Method Details
#name ⇒ Object
30
31
32
|
# File 'lib/rocx/elements/element.rb', line 30
def name
self.class.property_name || default_name
end
|
#namespace ⇒ Object
34
35
36
|
# File 'lib/rocx/elements/element.rb', line 34
def namespace
self.class.namespace || default_namespace
end
|
#tag ⇒ Object
26
27
28
|
# File 'lib/rocx/elements/element.rb', line 26
def tag
self.class.tag || default_tag
end
|
#to_xml(xml) ⇒ Object
38
39
40
|
# File 'lib/rocx/elements/element.rb', line 38
def to_xml(xml)
xml["w"].public_send(tag, xml_attributes)
end
|