Class: Osheet::Partial

Inherits:
Proc
  • Object
show all
Defined in:
lib/osheet/partial.rb

Direct Known Subclasses

Template

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Partial

this class is essentially a way to define a named definition block with arguments. If the partial is added to an element, any markup in it’s definition block is applied to the element. ie. the definition block will be instance_eval’d on workbook.



9
10
11
12
13
14
15
16
# File 'lib/osheet/partial.rb', line 9

def initialize(name)
  unless name.kind_of?(::String) || name.kind_of?(::Symbol)
    raise ArgumentError, "please use a string or symbol for the partial name."
  end

  @name = name.to_s
  super()
end