Sha256: 27f66ace60bce33fd29db2a12b5dec12bc206627288a42612d598c692829e662

Contents?: true

Size: 969 Bytes

Versions: 14

Compression:

Stored size: 969 Bytes

Contents

require 'happymapper'

module Saml
  module ComplexTypes
    module StatusResponseType
      extend ActiveSupport::Concern

      include RequestAbstractType

      included do
        attribute :in_response_to, String, :tag => 'InResponseTo'
        has_one :status, Saml::Elements::Status

        validates :in_response_to, :status, :presence => true
      end

      def initialize(*args)
        options = args.extract_options!
        @status = Saml::Elements::Status.new(status_code: Saml::Elements::StatusCode.new(value: options.delete(:status_value),
                                                                                         sub_status_value: options.delete(:sub_status_value)))
        @status.status_detail = Saml::Elements::StatusDetail.new(status_value: options.delete(:status_detail)) if options[:status_detail]
        super(*(args << options))
      end

      def success?
        status.status_code.success?
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
libsaml-2.14.0 lib/saml/complex_types/status_response_type.rb
libsaml-2.13.1 lib/saml/complex_types/status_response_type.rb
libsaml-2.12.1 lib/saml/complex_types/status_response_type.rb
libsaml-2.12.0 lib/saml/complex_types/status_response_type.rb
libsaml-2.11.2 lib/saml/complex_types/status_response_type.rb
libsaml-2.11.1 lib/saml/complex_types/status_response_type.rb
libsaml-2.11.0 lib/saml/complex_types/status_response_type.rb
libsaml-2.10.7 lib/saml/complex_types/status_response_type.rb
libsaml-2.10.6 lib/saml/complex_types/status_response_type.rb
libsaml-2.10.5 lib/saml/complex_types/status_response_type.rb
libsaml-2.10.4 lib/saml/complex_types/status_response_type.rb
libsaml-2.10.3 lib/saml/complex_types/status_response_type.rb
libsaml-2.10.2 lib/saml/complex_types/status_response_type.rb
libsaml-2.10.1 lib/saml/complex_types/status_response_type.rb