Sha256: 9a5806ebada1df9c9de0e3618ecba15db96c94b96ddfe6dfea1fe30de096cfa9

Contents?: true

Size: 553 Bytes

Versions: 7

Compression:

Stored size: 553 Bytes

Contents

module Osheet
  module MarkupElement

    # markup elements can add partial markup to themselves
    def add(partial_name, *args)
      if self.kind_of?(Workbook)
        # on: workbook
        if (partial = self.partials.get(partial_name))
          # add partial
          instance_exec(*args, &partial)
        end
      else
        # on: worksheet, column, row
        if self.workbook && (partial = self.workbook.partials.get(partial_name))
          # add partial
          instance_exec(*args, &partial)
        end
      end
    end

  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
osheet-0.10.0 lib/osheet/markup_element.rb
osheet-0.9.2 lib/osheet/markup_element.rb
osheet-0.9.1 lib/osheet/markup_element.rb
osheet-0.9.0 lib/osheet/markup_element.rb
osheet-0.8.0 lib/osheet/markup_element.rb
osheet-0.7.0 lib/osheet/markup_element.rb
osheet-0.6.0 lib/osheet/markup_element.rb