class RubyXL::OOXMLContainerObject
Parent class for OOXML container objects (for example, <fonts><font>...</font><font>...</font></fonts> that obscures the top-level container, allowing direct access to the contents as Array.
Public Class Methods
Source
# File lib/rubyXL/objects/ooxml_object.rb, line 382 def initialize(params = {}) array_content = params.delete(:_) super array_content.each_with_index { |v, i| self[i] = v } if array_content end
Calls superclass method
RubyXL::OOXMLObjectInstanceMethods::new
Protected Class Methods
Source
# File lib/rubyXL/objects/ooxml_object.rb, line 414 def define_count_attribute # Count will be inherited from Array. so no need to define it explicitly. define_attribute(:count, :uint, :required => true, :computed => true) end
Public Instance Methods
Source
# File lib/rubyXL/objects/ooxml_object.rb, line 403 def before_write_xml true end
Source
# File lib/rubyXL/objects/ooxml_object.rb, line 407 def inspect vars = [ super ] vars = self.instance_variables.each { |v| vars << "#{v}=#{instance_variable_get(v).inspect}" } "<#{self.class}: #{super} #{vars.join(", ")}>" end
Calls superclass method
Protected Instance Methods
Source
# File lib/rubyXL/objects/ooxml_object.rb, line 388 def get_node_object(child_node_params) if child_node_params[:is_array] then self else super end end
Calls superclass method
RubyXL::OOXMLObjectInstanceMethods#get_node_object
Source
# File lib/rubyXL/objects/ooxml_object.rb, line 395 def init_child_nodes(params) obtain_class_variable(:@@ooxml_child_nodes).each_value { |v| next if v[:is_array] # Only one collection node allowed per OOXMLContainerObject, and it is contained in itself. instance_variable_set("@#{v[:accessor]}", params[v[:accessor]]) } end