Class: MicrosoftTeamsIncomingWebhookRuby::Message

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

Defined Under Namespace

Modules: Error

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize {|@builder| ... } ⇒ Message

Returns a new instance of Message.

Yields:



17
18
19
20
21
# File 'lib/microsoft_teams_incoming_webhook_ruby/message.rb', line 17

def initialize(&block)
  @builder = OpenStruct.new
  yield @builder
  validate_builder
end

Instance Attribute Details

#builderObject (readonly)

Returns the value of attribute builder.



15
16
17
# File 'lib/microsoft_teams_incoming_webhook_ruby/message.rb', line 15

def builder
  @builder
end

Instance Method Details

#sendObject



23
24
25
26
27
28
# File 'lib/microsoft_teams_incoming_webhook_ruby/message.rb', line 23

def send
  validate_builder
  response = send_by_http
  check_failure_for(response)
  response
end