class InformantCommon::Event::Base
Public Class Methods
endpoint()
click to toggle source
# File lib/informant-common/event/base.rb, line 4 def self.endpoint raise 'Must implement' end
net_http_start_arguments()
click to toggle source
# File lib/informant-common/event/base.rb, line 26 def self.net_http_start_arguments @net_http_start_arguments ||= [endpoint.host, endpoint.port, use_ssl: endpoint.scheme == 'https'] end
Public Instance Methods
endpoint()
click to toggle source
# File lib/informant-common/event/base.rb, line 8 def endpoint self.class.endpoint end
net_http_start_arguments()
click to toggle source
# File lib/informant-common/event/base.rb, line 30 def net_http_start_arguments self.class.net_http_start_arguments end
post_request()
click to toggle source
# File lib/informant-common/event/base.rb, line 20 def post_request Net::HTTP::Post.new(endpoint, 'Authorization' => authorization_header_value, 'Content-Type' => 'application/json').tap { |r| r.body = to_json } end