Class: BlockKit::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/block_kit/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



19
20
21
22
23
# File 'lib/block_kit/configuration.rb', line 19

def initialize
  @autofix_on_validation = false
  @autofix_on_render = false
  @autofix_dangerously = false
end

Instance Attribute Details

#autofix_dangerouslyObject

Controls whether or not autofixes that may change the behavior of your view should be called. This is useful if you would rather post messages or publish views at the cost of behavioral quirks or changes rather than suffer from invalid_blocks errors.

If you'd prefer to run dangerous autofixers on demand, you can do this by calling fix_validation_errors(dangerous: true) on your blocks or surfaces.



17
18
19
# File 'lib/block_kit/configuration.rb', line 17

def autofix_dangerously
  @autofix_dangerously
end

#autofix_on_renderObject

Controls whether or not calling as_json on a block or surface will automatically apply any fixes that would make the block or surface valid.



9
10
11
# File 'lib/block_kit/configuration.rb', line 9

def autofix_on_render
  @autofix_on_render
end

#autofix_on_validationObject

Controls whether or not calling valid? or validate on a block or surface will automatically apply any fixes that would make the block or surface valid.



5
6
7
# File 'lib/block_kit/configuration.rb', line 5

def autofix_on_validation
  @autofix_on_validation
end