Class: TeamsIncomingClients::Teams::Poster
- Inherits:
-
Object
- Object
- TeamsIncomingClients::Teams::Poster
- Includes:
- Net
- Defined in:
- lib/teams_incoming_clients/models/teams/poster.rb
Constant Summary collapse
- CONTENT_TYPE =
{ 'Content-Type' => 'application/json' }
Instance Method Summary collapse
-
#initialize(webhook_url) ⇒ Poster
constructor
A new instance of Poster.
- #post(message) ⇒ Bool
Constructor Details
#initialize(webhook_url) ⇒ Poster
Returns a new instance of Poster.
8 9 10 11 12 13 |
# File 'lib/teams_incoming_clients/models/teams/poster.rb', line 8 def initialize(webhook_url) raise ArgumentError.new("Should be set webhook_url. got: #{webhook_url}") if webhook_url.to_s.empty? @webhook_url = webhook_url @webhook_uri = URI.parse(webhook_url) end |
Instance Method Details
#post(message) ⇒ Bool
16 17 18 19 20 21 |
# File 'lib/teams_incoming_clients/models/teams/poster.rb', line 16 def post() request = build_post_request() result = client.request(request) result.code == "200" end |