Class: Osheet::Partial

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

Direct Known Subclasses

Template

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Partial

Returns a new instance of Partial.



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

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

Instance Attribute Details

#nameObject (readonly)

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.



8
9
10
# File 'lib/osheet/partial.rb', line 8

def name
  @name
end