Sha256: 5a09d2b2571048174cc54630ef06ad10a47d619e6a442df3b2ad84d2f3f419f1

Contents?: true

Size: 800 Bytes

Versions: 2

Compression:

Stored size: 800 Bytes

Contents

# frozen_string_literal: true

require 'faraday'

require_relative 'events'
require_relative 'event_adapter'
require 'roko/source/base/report_events'

module Roko
  module Source
    # event from confluence
    module Confluence
      # report events from confluence
      class ReportEvents < Roko::Source::Base::ReportEvents
        def client
          Faraday.new(url: ENV['CONFLUENCE_URL']) do |conn|
            conn.basic_auth(ENV['CONFLUENCE_USER'], ENV['CONFLUENCE_PASSWORD'])
            conn.response :json, parser_options: { object_class: OpenStruct }
          end
        end

        def fetch_service_event(client)
          Events.new(client).fetch
        end

        def to_report_event(event)
          EventAdapter.to_report_event(event)
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
roko-0.2.1 lib/roko/source/confluence/report_events.rb
roko-0.2.0 lib/roko/source/confluence/report_events.rb