westernmilling/agris.rb

View on GitHub
lib/agris/api/messages/changed_query_base.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
# frozen_string_literal: true
module Agris
  module Api
    module Messages
      class ChangedQueryBase < QueryBase
        def initialize(time, detail)
          @time = time
          @detail = detail
        end

        protected

        def input_hash
          input_base_hash
            .merge(
              :@details => @detail,
              locid: {
                :@datetime => @time.strftime('%Y-%m-%dT%H:%M:%S'),
                :@id => nil,
                :@loccode => nil
              }
            )
        end
      end
    end
  end
end