Class: Slack::BlockKit::Element::SelectElement
- Inherits:
-
Slack::BlockKit::Element
- Object
- Slack::BlockKit::Element
- Slack::BlockKit::Element::SelectElement
- Defined in:
- lib/slack/block_kit/element/select_element.rb
Direct Known Subclasses
ChannelsSelectElement, ConversationsSelectElement, ExternalSelectElement, StaticSelectElement, UsersSelectElement
Instance Attribute Summary collapse
-
#confirm ⇒ Object
Returns the value of attribute confirm.
-
#placeholder ⇒ Object
Returns the value of attribute placeholder.
Attributes inherited from Slack::BlockKit::Element
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Slack::BlockKit::Element
Instance Attribute Details
#confirm ⇒ Object
Returns the value of attribute confirm.
7 8 9 |
# File 'lib/slack/block_kit/element/select_element.rb', line 7 def confirm @confirm end |
#placeholder ⇒ Object
Returns the value of attribute placeholder.
7 8 9 |
# File 'lib/slack/block_kit/element/select_element.rb', line 7 def placeholder @placeholder end |
Class Method Details
.populate(hash, object) ⇒ Object
9 10 11 12 13 14 |
# File 'lib/slack/block_kit/element/select_element.rb', line 9 def self.populate(hash, object) object.placeholder = hash.fetch(:placeholder) object.confirm = hash[:confirm] if hash.key?(:confirm) super(hash, object) end |
Instance Method Details
#to_h ⇒ Object
36 37 38 39 40 41 |
# File 'lib/slack/block_kit/element/select_element.rb', line 36 def to_h super.merge( placeholder: placeholder.to_h, confirm: confirm&.to_h ) end |
#valid? ⇒ Boolean
16 17 18 |
# File 'lib/slack/block_kit/element/select_element.rb', line 16 def valid? !(@placeholder.nil? || @placeholder.empty?) end |