Class: Slack::BlockKit::Element::DatePickerElement
- Inherits:
-
Slack::BlockKit::Element
- Object
- Slack::BlockKit::Element
- Slack::BlockKit::Element::DatePickerElement
- Defined in:
- lib/slack/block_kit/element/date_picker_element.rb
Instance Attribute Summary collapse
-
#confirm ⇒ Object
Returns the value of attribute confirm.
-
#initial_date ⇒ Object
Returns the value of attribute initial_date.
-
#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.
8 9 10 |
# File 'lib/slack/block_kit/element/date_picker_element.rb', line 8 def confirm @confirm end |
#initial_date ⇒ Object
Returns the value of attribute initial_date.
8 9 10 |
# File 'lib/slack/block_kit/element/date_picker_element.rb', line 8 def initial_date @initial_date end |
#placeholder ⇒ Object
Returns the value of attribute placeholder.
8 9 10 |
# File 'lib/slack/block_kit/element/date_picker_element.rb', line 8 def placeholder @placeholder end |
Class Method Details
.populate(hash, object) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/slack/block_kit/element/date_picker_element.rb', line 10 def self.populate(hash, object) object.placeholder = hash.fetch(:placeholder) if hash[:placeholder] object.confirm = hash.fetch(:confirm) if hash[:confirm] object.initial_date = hash.fetch(:initial_date) if hash[:initial_date] super(hash, object) end |
Instance Method Details
#to_h ⇒ Object
46 47 48 49 50 51 52 |
# File 'lib/slack/block_kit/element/date_picker_element.rb', line 46 def to_h super.merge( initial_date: initial_date, placeholder: placeholder&.to_h, confirm: confirm&.to_h ).compact end |
#type ⇒ Object
18 19 20 |
# File 'lib/slack/block_kit/element/date_picker_element.rb', line 18 def type 'datepicker' end |