Class: Slackened::BlockKit::Blocks::Base
- Inherits:
-
Object
- Object
- Slackened::BlockKit::Blocks::Base
- Defined in:
- lib/slackened/block_kit/blocks/base.rb
Instance Attribute Summary collapse
-
#block ⇒ Object
Returns the value of attribute block.
Instance Method Summary collapse
- #set(block) ⇒ Object
-
#to_h ⇒ Object
recursion?.
Instance Attribute Details
#block ⇒ Object
Returns the value of attribute block.
22 23 24 |
# File 'lib/slackened/block_kit/blocks/base.rb', line 22 def block @block end |
Instance Method Details
#set(block) ⇒ Object
24 25 26 |
# File 'lib/slackened/block_kit/blocks/base.rb', line 24 def set(block) @block = block end |
#to_h ⇒ Object
recursion?
29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/slackened/block_kit/blocks/base.rb', line 29 def to_h @block.to_h do |key, value| case value when Array [key, value.map(&:to_h)] when Base [key, value.to_h] else [key, value] end end end |