class Slack::BlockKit::Element::ExternalSelectElement

Attributes

initial_option[R]
min_query_length[R]

Public Class Methods

populate(hash, object) click to toggle source
Calls superclass method
# 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

Public Instance Methods

initial_option=(obj) click to toggle source
# File lib/slack/block_kit/element/external_select_element.rb, line 17
def initial_option=(obj)
  raise TypeError, 'initial_option must be a Option Object' unless obj.is_a?(CompositionObjects::Option)

  @initial_option = obj
end
min_query_length=(length) click to toggle source
# File lib/slack/block_kit/element/external_select_element.rb, line 23
def min_query_length=(length)
  raise TypeError, 'min_query_length must be an integer' unless length.respond_to?(:to_int)

  @min_query_length = length.to_i
end
to_h() click to toggle source
Calls superclass method
# 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