Class: Slack::BlockKit::CompositionObjects::ConfirmationDialog

Inherits:
Object
  • Object
show all
Defined in:
lib/slack/block_kit/composition_objects/confirmation_dialog.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#confirmObject

Returns the value of attribute confirm.



8
9
10
# File 'lib/slack/block_kit/composition_objects/confirmation_dialog.rb', line 8

def confirm
  @confirm
end

#denyObject

Returns the value of attribute deny.



8
9
10
# File 'lib/slack/block_kit/composition_objects/confirmation_dialog.rb', line 8

def deny
  @deny
end

#textObject

Returns the value of attribute text.



8
9
10
# File 'lib/slack/block_kit/composition_objects/confirmation_dialog.rb', line 8

def text
  @text
end

#titleObject

Returns the value of attribute title.



8
9
10
# File 'lib/slack/block_kit/composition_objects/confirmation_dialog.rb', line 8

def title
  @title
end

Class Method Details

.[](hash) ⇒ Object



10
11
12
13
14
15
16
17
# File 'lib/slack/block_kit/composition_objects/confirmation_dialog.rb', line 10

def self.[](hash)
  new.tap do |object|
    object.title = hash.fetch(:title)
    object.text = hash.fetch(:text)
    object.confirm = hash.fetch(:confirm)
    object.deny = hash.fetch(:deny)
  end
end

Instance Method Details

#to_hObject



50
51
52
53
54
55
# File 'lib/slack/block_kit/composition_objects/confirmation_dialog.rb', line 50

def to_h
  { title: title.to_h,
    text: text.to_h,
    confirm: confirm.to_h,
    deny: deny.to_h }.compact
end