class Slax::Complex::AttachmentBuilder
Constants
- VALID_PARAMS
Public Class Methods
new()
click to toggle source
# File lib/slax/complex/attachment_builder.rb, line 9 def initialize @payload = { fallback: "" } end
Public Instance Methods
fields(title, value, short = nil)
click to toggle source
# File lib/slax/complex/attachment_builder.rb, line 24 def fields(title, value, short = nil) @payload[:fields] ||= [] @sub_payload = { title: title, value: value } unless short.nil? @sub_payload[:short] = short end @payload[:fields] << @sub_payload end
method_missing(name, *args, &block)
click to toggle source
Calls superclass method
# File lib/slax/complex/attachment_builder.rb, line 13 def method_missing(name, *args, &block) if VALID_PARAMS.include?(name) if args.count > 0 @payload[name] = args.join(' ') @payload[name] end else super end end
payload()
click to toggle source
# File lib/slax/complex/attachment_builder.rb, line 41 def payload @payload end
timestamp(time)
click to toggle source
# File lib/slax/complex/attachment_builder.rb, line 35 def timestamp(time) @payload[:ts] = time.to_i end
Also aliased as: ts