Class: Osheet::Partial
- Inherits:
-
Proc
- Object
- Proc
- Osheet::Partial
- Defined in:
- lib/osheet/partial.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
this class is essentially a way to define a named definition block with arguments.
Instance Method Summary collapse
-
#initialize(name) ⇒ Partial
constructor
A new instance of Partial.
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
#name ⇒ Object (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 |