Class: HtmlPage::Capture
- Inherits:
-
Object
- Object
- HtmlPage::Capture
- Defined in:
- lib/html_page/capture.rb
Instance Method Summary collapse
- #capture ⇒ Object
-
#initialize(context, &block) ⇒ Capture
constructor
A new instance of Capture.
Constructor Details
#initialize(context, &block) ⇒ Capture
Returns a new instance of Capture.
3 4 5 6 |
# File 'lib/html_page/capture.rb', line 3 def initialize(context, &block) @context = context @block = block || NullBlock.new end |
Instance Method Details
#capture ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/html_page/capture.rb', line 8 def capture if block.arity > 0 block.call(*block_arguments) end [head.content, body.content] end |