Class: Prawn::Core::Chunk
- Inherits:
-
Object
- Object
- Prawn::Core::Chunk
- Defined in:
- lib/prawn/core/chunk.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#command ⇒ Object
readonly
Returns the value of attribute command.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
- #[](attr) ⇒ Object
- #[]=(attr, value) ⇒ Object
- #content ⇒ Object
-
#initialize(command, params = {}, &action) ⇒ Chunk
constructor
A new instance of Chunk.
- #to_pdf ⇒ Object
Constructor Details
#initialize(command, params = {}, &action) ⇒ Chunk
Returns a new instance of Chunk.
4 5 6 7 8 |
# File 'lib/prawn/core/chunk.rb', line 4 def initialize(command, params={}, &action) @command = command @params = params @action = action end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
10 11 12 |
# File 'lib/prawn/core/chunk.rb', line 10 def action @action end |
#command ⇒ Object (readonly)
Returns the value of attribute command.
10 11 12 |
# File 'lib/prawn/core/chunk.rb', line 10 def command @command end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
10 11 12 |
# File 'lib/prawn/core/chunk.rb', line 10 def params @params end |
Instance Method Details
#[](attr) ⇒ Object
27 28 29 |
# File 'lib/prawn/core/chunk.rb', line 27 def [](attr) @params[attr] end |
#[]=(attr, value) ⇒ Object
31 32 33 |
# File 'lib/prawn/core/chunk.rb', line 31 def []=(attr, value) @params[attr] = value end |
#content ⇒ Object
12 13 14 |
# File 'lib/prawn/core/chunk.rb', line 12 def content action.call(self) end |