Class: OoxmlParser::ChartLegend
- Inherits:
-
Object
- Object
- OoxmlParser::ChartLegend
- Defined in:
- lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_legend.rb
Instance Attribute Summary collapse
-
#overlay ⇒ Object
Returns the value of attribute overlay.
-
#position ⇒ Object
Returns the value of attribute position.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(position = :right, overlay = false) ⇒ ChartLegend
constructor
A new instance of ChartLegend.
-
#position_with_overlay ⇒ Symbol
Return combined data from @position and @overlay If there is no overlay - return :right f.e.
Constructor Details
#initialize(position = :right, overlay = false) ⇒ ChartLegend
Returns a new instance of ChartLegend.
6 7 8 9 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_legend.rb', line 6 def initialize(position = :right, = false) @position = position = end |
Instance Attribute Details
#overlay ⇒ Object
Returns the value of attribute overlay.
4 5 6 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_legend.rb', line 4 def end |
#position ⇒ Object
Returns the value of attribute position.
4 5 6 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_legend.rb', line 4 def position @position end |
Class Method Details
.parse(legend_node) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_legend.rb', line 20 def self.parse(legend_node) legend = ChartLegend.new legend_node.xpath('*').each do |legend_node_child| case legend_node_child.name when 'legendPos' legend.position = Alignment.parse(legend_node_child.attribute('val')) when 'overlay' legend. = true if legend_node_child.attribute('val').value.to_s == '1' end end legend end |
Instance Method Details
#position_with_overlay ⇒ Symbol
Return combined data from @position and @overlay If there is no overlay - return :right f.e. If there is overlay - return :right_overlay
15 16 17 18 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_legend.rb', line 15 def return "#{@position}_overlay".to_sym if @position end |