Class: Saml::Kit::Bindings::Binding

Inherits:
Object
  • Object
show all
Defined in:
lib/saml/kit/bindings/binding.rb

Overview

This class is a base class for SAML bindings.

Direct Known Subclasses

HttpPost, HttpRedirect

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(binding:, location:) ⇒ Binding

Returns a new instance of Binding


11
12
13
14
# File 'lib/saml/kit/bindings/binding.rb', line 11

def initialize(binding:, location:)
  @binding = binding
  @location = location
end

Instance Attribute Details

#bindingObject (readonly)

Returns the value of attribute binding


9
10
11
# File 'lib/saml/kit/bindings/binding.rb', line 9

def binding
  @binding
end

#locationObject (readonly)

Returns the value of attribute location


9
10
11
# File 'lib/saml/kit/bindings/binding.rb', line 9

def location
  @location
end

Instance Method Details

#==(other) ⇒ Object


32
33
34
# File 'lib/saml/kit/bindings/binding.rb', line 32

def ==(other)
  to_s == other.to_s
end

#binding?(other) ⇒ Boolean

Returns:

  • (Boolean)

16
17
18
# File 'lib/saml/kit/bindings/binding.rb', line 16

def binding?(other)
  binding == other
end

#deserialize(_params) ⇒ Object

Raises:

  • (ArgumentError)

24
25
26
# File 'lib/saml/kit/bindings/binding.rb', line 24

def deserialize(_params)
  raise ArgumentError, 'Unsupported binding'
end

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)

36
37
38
# File 'lib/saml/kit/bindings/binding.rb', line 36

def eql?(other)
  self == other
end

#hashObject


40
41
42
# File 'lib/saml/kit/bindings/binding.rb', line 40

def hash
  to_s.hash
end

#inspectObject


48
49
50
# File 'lib/saml/kit/bindings/binding.rb', line 48

def inspect
  to_h.inspect
end

#serializeObject


20
21
22
# File 'lib/saml/kit/bindings/binding.rb', line 20

def serialize(*)
  []
end

#to_hObject


28
29
30
# File 'lib/saml/kit/bindings/binding.rb', line 28

def to_h
  { binding: binding, location: location }
end

#to_sObject


44
45
46
# File 'lib/saml/kit/bindings/binding.rb', line 44

def to_s
  "#{location}#{binding}"
end