Class: Slack::BlockKit::Element::ExternalSelectElement

Inherits:
SelectElement show all
Defined in:
lib/slack/block_kit/element/external_select_element.rb

Direct Known Subclasses

MultiExternalSelectElement

Instance Attribute Summary collapse

Attributes inherited from SelectElement

#confirm, #placeholder

Attributes inherited from Slack::BlockKit::Element

#action_id

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from SelectElement

#valid?

Methods inherited from Slack::BlockKit::Element

[], #type, #valid?

Instance Attribute Details

#initial_optionObject

Returns the value of attribute initial_option.



8
9
10
# File 'lib/slack/block_kit/element/external_select_element.rb', line 8

def initial_option
  @initial_option
end

#min_query_lengthObject

Returns the value of attribute min_query_length.



8
9
10
# File 'lib/slack/block_kit/element/external_select_element.rb', line 8

def min_query_length
  @min_query_length
end

Class Method Details

.populate(hash, object) ⇒ Object



10
11
12
13
14
15
# File 'lib/slack/block_kit/element/external_select_element.rb', line 10

def self.populate(hash, object)
  object.initial_option = hash[:initial_option] if hash.key?(:initial_option)
  object.min_query_length = hash[:min_query_length] if hash.key?(:min_query_length)

  super(hash, object)
end

Instance Method Details

#to_hObject



29
30
31
32
33
34
# File 'lib/slack/block_kit/element/external_select_element.rb', line 29

def to_h
  super.merge(
    initial_option: initial_option&.to_h,
    min_query_length: min_query_length || 3
  ).compact
end