Class: Teams::Api::ReactionClient
- Inherits:
-
Object
- Object
- Teams::Api::ReactionClient
- Defined in:
- lib/teams/api/reaction_client.rb
Instance Attribute Summary collapse
-
#http ⇒ Object
readonly
Returns the value of attribute http.
-
#service_url ⇒ Object
readonly
Returns the value of attribute service_url.
Instance Method Summary collapse
- #add(conversation_id, activity_id, reaction_type) ⇒ Object
- #delete(conversation_id, activity_id, reaction_type) ⇒ Object
-
#initialize(service_url:, http:) ⇒ ReactionClient
constructor
A new instance of ReactionClient.
Constructor Details
#initialize(service_url:, http:) ⇒ ReactionClient
Returns a new instance of ReactionClient.
10 11 12 13 |
# File 'lib/teams/api/reaction_client.rb', line 10 def initialize(service_url:, http:) @service_url = service_url.sub(%r{/+\z}, "") @http = http end |
Instance Attribute Details
#http ⇒ Object (readonly)
Returns the value of attribute http.
8 9 10 |
# File 'lib/teams/api/reaction_client.rb', line 8 def http @http end |
#service_url ⇒ Object (readonly)
Returns the value of attribute service_url.
8 9 10 |
# File 'lib/teams/api/reaction_client.rb', line 8 def service_url @service_url end |
Instance Method Details
#add(conversation_id, activity_id, reaction_type) ⇒ Object
15 16 17 |
# File 'lib/teams/api/reaction_client.rb', line 15 def add(conversation_id, activity_id, reaction_type) http.put(path(conversation_id, activity_id, reaction_type)) end |
#delete(conversation_id, activity_id, reaction_type) ⇒ Object
19 20 21 |
# File 'lib/teams/api/reaction_client.rb', line 19 def delete(conversation_id, activity_id, reaction_type) http.delete(path(conversation_id, activity_id, reaction_type)) end |