Class: SowprogApiRuby
- Inherits:
-
Object
- Object
- SowprogApiRuby
- Defined in:
- lib/sowprog-api-ruby.rb
Defined Under Namespace
Classes: Configuration
Class Method Summary collapse
Class Method Details
.configuration ⇒ Object
24 25 26 |
# File 'lib/sowprog-api-ruby.rb', line 24 def self.configuration @configuration ||= Configuration.new end |
.configure {|configuration| ... } ⇒ Object
28 29 30 |
# File 'lib/sowprog-api-ruby.rb', line 28 def self.configure(&block) yield(configuration) end |
.scheduled_events ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/sowprog-api-ruby.rb', line 11 def self.scheduled_events url = URI('https://agenda.sowprog.com/rest/v1_2/scheduledEvents/search') request = Net::HTTP::Get.new(url) request["Accept"] = "application/json" request["Content-Type"] = "application/json" request["Authorization"] = "Basic " + Base64.encode64("#{SowprogApiRuby.configuration.user_name}:#{SowprogApiRuby.configuration.password}").strip http = Net::HTTP.new(url.host, url.port) http.use_ssl = true response = http.request request return JSON.parse(response.body) end |