Class: SlackLayout
- Inherits:
-
Object
show all
- Defined in:
- lib/slack_layout.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
Returns a new instance of SlackLayout.
9
10
11
12
13
14
|
# File 'lib/slack_layout.rb', line 9
def initialize
Slack::BlockKit.blocks do |layout|
@layout = layout
end
build
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
28
29
30
|
# File 'lib/slack_layout.rb', line 28
def method_missing(method, *args, &block)
layout.send(method, *args, &block)
end
|
Instance Attribute Details
#layout ⇒ Object
Returns the value of attribute layout.
7
8
9
|
# File 'lib/slack_layout.rb', line 7
def layout
@layout
end
|
Instance Method Details
#as_json ⇒ Object
24
25
26
|
# File 'lib/slack_layout.rb', line 24
def as_json
layout.as_json
end
|
#blocks ⇒ Object
20
21
22
|
# File 'lib/slack_layout.rb', line 20
def blocks
raise NotImplementedError
end
|
#build ⇒ Object
16
17
18
|
# File 'lib/slack_layout.rb', line 16
def build
blocks
end
|