class SlackMessenger::AttachmentField
Public Class Methods
new(options = {})
click to toggle source
# File lib/slack_messenger/attachment_field.rb, line 3 def initialize(options = {}) @title = options[:title] @value = options[:value] || "Attachment Text" @short = options[:short] end
Public Instance Methods
as_json()
click to toggle source
# File lib/slack_messenger/attachment_field.rb, line 9 def as_json hash = {value: @value} hash[:title] = @title unless @title.nil? hash[:short] = @title unless @short.nil? hash end