Sha256: b9dea171d3aaf9f86d1faffc9dd0267a73bdc1db76e36cc32ba7acfae11f8594

Contents?: true

Size: 726 Bytes

Versions: 6

Compression:

Stored size: 726 Bytes

Contents

module TMS
  class IpawsAlert

    include InstanceResource

    writeable_attributes(
      :identifier,
      :sender,
      :sent,
      :status,
      :msgType,
      :source,
      :scope,
      :restriction,
      :addresses,
      :code,
      :note,
      :references,
      :incidents,
      :info
    )

    attr_accessor :ipaws_response

    def process_response(response, method)
      # All IPAWS responses are 200, even if there are errors.
      # Capture the IPAWS response on a 200 response to POST (create alert)
      if method == :post && response.status == 200
        self.ipaws_response = response.body
        true
      else
        self.ipaws_response = nil
        super
      end
    end

  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
govdelivery-tms-0.8.0 lib/govdelivery-tms/resource/ipaws_alert.rb
tms_client-0.6.0 lib/tms_client/resource/ipaws_alert.rb
tms_client-0.5.4 lib/tms_client/resource/ipaws_alert.rb
tms_client-0.5.3 lib/tms_client/resource/ipaws_alert.rb
tms_client-0.5.2 lib/tms_client/resource/ipaws_alert.rb
tms_client-0.5.1 lib/tms_client/resource/ipaws_alert.rb