Class: StandupMD::Post::Message

Inherits:
Object
  • Object
show all
Defined in:
lib/standup_md/post/message.rb

Overview

A platform-neutral message to send through a posting adapter.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(entry:, text:, channel:, adapter:) ⇒ Message

Builds a message for a posting adapter.

Parameters:

  • entry (StandupMD::Entry)
  • text (String)
  • channel (String, nil)
  • adapter (String, Symbol)


39
40
41
42
43
44
# File 'lib/standup_md/post/message.rb', line 39

def initialize(entry:, text:, channel:, adapter:)
  @entry = entry
  @text = text.to_s
  @channel = channel
  @adapter = adapter.to_sym
end

Instance Attribute Details

#adapterSymbol (readonly)

The adapter name requested by the caller.

Returns:

  • (Symbol)


30
31
32
# File 'lib/standup_md/post/message.rb', line 30

def adapter
  @adapter
end

#channelString? (readonly)

The destination channel, room, or conversation identifier.

Returns:

  • (String, nil)


24
25
26
# File 'lib/standup_md/post/message.rb', line 24

def channel
  @channel
end

#entryStandupMD::Entry (readonly)

The standup entry being posted.

Returns:



12
13
14
# File 'lib/standup_md/post/message.rb', line 12

def entry
  @entry
end

#textString (readonly)

The rendered message body.

Returns:

  • (String)


18
19
20
# File 'lib/standup_md/post/message.rb', line 18

def text
  @text
end