Class: Uniword::Docx::ChartPart
- Defined in:
- lib/uniword/docx/chart_part.rb
Overview
A chart part (word/charts/chartN.xml) held by the package.
The content is the raw chart XML String. Replaces the former
{ xml:, target: } hash entries in chart_parts.
Constant Summary
Constants inherited from Part
Instance Attribute Summary
Attributes inherited from Part
#content, #content_type, #definition, #r_id, #rel_type, #target
Instance Method Summary collapse
-
#[](key) ⇒ Object
Hash-style read compatibility (+:xml+ in addition to the Part keys).
-
#initialize(r_id: nil, target: nil, content: nil, **rest) ⇒ ChartPart
constructor
A new instance of ChartPart.
-
#xml ⇒ String?
Raw chart XML (alias for content).
Methods inherited from Part
Constructor Details
#initialize(r_id: nil, target: nil, content: nil, **rest) ⇒ ChartPart
Returns a new instance of ChartPart.
13 14 15 16 17 18 |
# File 'lib/uniword/docx/chart_part.rb', line 13 def initialize(r_id: nil, target: nil, content: nil, **rest) super( definition: Ooxml::PartRegistry.find_by_key(:chart), r_id: r_id, target: target, content: content, **rest ) end |
Instance Method Details
#[](key) ⇒ Object
Hash-style read compatibility (+:xml+ in addition to the Part keys).
29 30 31 |
# File 'lib/uniword/docx/chart_part.rb', line 29 def [](key) key.to_sym == :xml ? content : super end |
#xml ⇒ String?
Raw chart XML (alias for content).
23 24 25 |
# File 'lib/uniword/docx/chart_part.rb', line 23 def xml content end |