lib/osheet/workbook.rb in osheet-0.5.0 vs lib/osheet/workbook.rb in osheet-0.6.0

- old
+ new

@@ -1,22 +1,27 @@ require 'osheet/instance' +require 'osheet/associations' +require 'osheet/markup_element' require 'osheet/style_set' require 'osheet/template_set' +require 'osheet/partial_set' require 'osheet/worksheet' require 'osheet/xmlss_writer' module Osheet class Workbook include Instance include Associations + include MarkupElement hm :worksheets def initialize(&block) set_ivar(:title, nil) set_ivar(:styles, StyleSet.new) set_ivar(:templates, TemplateSet.new) + set_ivar(:partials, PartialSet.new) if block_given? set_binding_ivars(block.binding) instance_eval(&block) end end @@ -30,9 +35,13 @@ get_ivar(:styles) end def template(element, name, &block); push_ivar(:templates, Template.new(element, name, &block)); end def templates get_ivar(:templates) + end + def partial(name, &block); push_ivar(:partials, Partial.new(name, &block)); end + def partials + get_ivar(:partials) end def attributes { :title => get_ivar(:title) } end