Class: ActiveUsage::Adapters::Http::Client
- Inherits:
-
Object
- Object
- ActiveUsage::Adapters::Http::Client
- Defined in:
- lib/active_usage/adapters/http.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(url, api_key, events) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(url, api_key, events) ⇒ Client
Returns a new instance of Client.
7 8 9 10 11 |
# File 'lib/active_usage/adapters/http.rb', line 7 def initialize(url, api_key, events) @uri = URI(url) @api_key = api_key @events = events end |
Instance Method Details
#call ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/active_usage/adapters/http.rb', line 13 def call Net::HTTP.start(@uri.host, @uri.port, ) do |http| http.request(request).is_a?(Net::HTTPSuccess) end rescue StandardError false end |