Class: RubyXL::OOXMLContainerObject
- Inherits:
-
Array
- Object
- Array
- RubyXL::OOXMLContainerObject
- Extended by:
- OOXMLObjectClassMethods
- Includes:
- OOXMLObjectInstanceMethods
- Defined in:
- lib/rubyXL/objects/ooxml_object.rb
Overview
Parent class for OOXML conainer objects (for example, <fonts><font>...</font><font>...</font></fonts>
that obscures the top-level container, allowing direct access to the contents as Array
.
Direct Known Subclasses
Borders, BreakList, CellSmartTags, CellStyleXFs, CellStyles, CellWatches, CellXFs, ConditionalFormatting, CustomFilters, CustomProperties, CustomSheetViews, CustomWorkbookViews, DataConsolidationReferences, DefinedNames, EmbeddedControls, ExternalReferences, Fills, Fonts, FunctionGroups, Hyperlinks, IgnoredErrors, IndexedColors, MRUColors, MergedCells, NumberFormats, OLEObjects, PivotCaches, PivotReferences, ProtectedRanges, Scenarios, Sheets, SmartTagTypes, SmartTags, TableParts, TableStyles, WebPublishObjects, WebPublishingItems, WorkbookViews, WorksheetViews
Class Method Summary collapse
Instance Method Summary collapse
- #before_write_xml ⇒ Object
-
#initialize(params = {}) ⇒ OOXMLContainerObject
constructor
A new instance of OOXMLContainerObject.
- #inspect ⇒ Object
Methods included from OOXMLObjectClassMethods
define_attribute, define_child_node, define_element_name, obtain_class_variable, parse, set_countable
Methods included from OOXMLObjectInstanceMethods
#dup, #index_in_collection, #write_xml
Constructor Details
#initialize(params = {}) ⇒ OOXMLContainerObject
Returns a new instance of OOXMLContainerObject.
341 342 343 344 345 |
# File 'lib/rubyXL/objects/ooxml_object.rb', line 341 def initialize(params = {}) array_content = params.delete(:_) super array_content.each_with_index { |v, i| self[i] = v } if array_content end |
Class Method Details
.define_count_attribute ⇒ Object
373 374 375 376 |
# File 'lib/rubyXL/objects/ooxml_object.rb', line 373 def define_count_attribute # Count will be inherited from Array. so no need to define it explicitly. define_attribute(:count, :int, :required => true, :computed => true) end |
Instance Method Details
#before_write_xml ⇒ Object
362 363 364 |
# File 'lib/rubyXL/objects/ooxml_object.rb', line 362 def before_write_xml true end |
#inspect ⇒ Object
366 367 368 369 370 |
# File 'lib/rubyXL/objects/ooxml_object.rb', line 366 def inspect vars = [ super ] vars = self.instance_variables.each { |v| vars << "#{v}=#{instance_variable_get(v).inspect}" } "<#{self.class}: #{super} #{vars.join(", ")}>" end |