Class: Teams::Api::ReactionClient

Inherits:
Object
  • Object
show all
Defined in:
lib/teams/api/reaction_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#httpObject (readonly)

Returns the value of attribute http.



8
9
10
# File 'lib/teams/api/reaction_client.rb', line 8

def http
  @http
end

#service_urlObject (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