require 'faraday' module WebhookStopwatch class Client attr_reader :base_url def initialize(base_url) @base_url = base_url end def start(message_id, timestamp) connection.post("/messages/#{message_id}/start", "timestamp" => timestamp). success? end def stop(message_id, timestamp) connection.post("/messages/#{message_id}/stop", "timestamp" => timestamp). success? end private def connection Faraday.new(:url => base_url) end end end