Module: SAML2::Endpoint::ChoiceHelpers

Included in:
Array, Indexed::Array
Defined in:
lib/saml2/endpoint.rb

Instance Method Summary collapse

Instance Method Details

#choose_binding(*bindings) ⇒ String

Choose a binding supported by this list of endpoints

Returns:

  • (String)


11
12
13
# File 'lib/saml2/endpoint.rb', line 11

def choose_binding(*bindings)
  (bindings & map(&:binding)).first
end

#choose_endpoint(binding) ⇒ Endpoint?

Choose an endpoint from this list of endpoints that supports a given binding

Parameters:

  • binding (String)

    the binding that must match

Returns:



19
20
21
# File 'lib/saml2/endpoint.rb', line 19

def choose_endpoint(binding)
  find { |endpoint| endpoint.binding == binding }
end