Class: Kanal::Core::Helpers::ResponseBlock
- Inherits:
-
Object
- Object
- Kanal::Core::Helpers::ResponseBlock
- Defined in:
- lib/kanal/core/helpers/response_block.rb
Overview
Response block stores block of code to be executed at runtime and output to be created
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
Instance Method Summary collapse
-
#async? ⇒ Boolean
Should execution of block be async?.
-
#functional? ⇒ Boolean
Whether response block is functional, means no output should be processed after execution of block.
-
#initialize(block, async: false, functional: false) ⇒ ResponseBlock
constructor
Creates response block that stores block for evaluation at runtime, when output is constructed.
Constructor Details
#initialize(block, async: false, functional: false) ⇒ ResponseBlock
Creates response block that stores block for evaluation at runtime, when output is constructed
21 22 23 24 25 |
# File 'lib/kanal/core/helpers/response_block.rb', line 21 def initialize(block, async: false, functional: false) @block = block @async = async @functional = functional end |
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
11 12 13 |
# File 'lib/kanal/core/helpers/response_block.rb', line 11 def block @block end |
Instance Method Details
#async? ⇒ Boolean
Should execution of block be async?
42 43 44 |
# File 'lib/kanal/core/helpers/response_block.rb', line 42 def async? @async end |
#functional? ⇒ Boolean
Whether response block is functional, means no output should be processed after execution of block
33 34 35 |
# File 'lib/kanal/core/helpers/response_block.rb', line 33 def functional? @functional end |