Class: Slkecho::SlackRequest::PostMessage::Params

Inherits:
Struct
  • Object
show all
Defined in:
lib/slkecho/slack_request/post_message.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#blocksObject

Returns the value of attribute blocks

Returns:

  • (Object)

    the current value of blocks



13
14
15
# File 'lib/slkecho/slack_request/post_message.rb', line 13

def blocks
  @blocks
end

#channelObject

Returns the value of attribute channel

Returns:

  • (Object)

    the current value of channel



13
14
15
# File 'lib/slkecho/slack_request/post_message.rb', line 13

def channel
  @channel
end

#icon_emojiObject

Returns the value of attribute icon_emoji

Returns:

  • (Object)

    the current value of icon_emoji



13
14
15
# File 'lib/slkecho/slack_request/post_message.rb', line 13

def icon_emoji
  @icon_emoji
end

#icon_urlObject

Returns the value of attribute icon_url

Returns:

  • (Object)

    the current value of icon_url



13
14
15
# File 'lib/slkecho/slack_request/post_message.rb', line 13

def icon_url
  @icon_url
end

#usernameObject

Returns the value of attribute username

Returns:

  • (Object)

    the current value of username



13
14
15
# File 'lib/slkecho/slack_request/post_message.rb', line 13

def username
  @username
end

Instance Method Details

#to_request_bodyObject



14
15
16
17
18
19
20
21
22
# File 'lib/slkecho/slack_request/post_message.rb', line 14

def to_request_body
  JSON.dump({
              channel: channel,
              blocks: blocks,
              username: username,
              icon_url: icon_url,
              icon_emoji: icon_emoji
            })
end