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

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

Overview

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.



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

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

Instance Attribute Details

#bindingObject (readonly)

Returns the value of attribute binding.



6
7
8
# File 'lib/saml/kit/bindings/binding.rb', line 6

def binding
  @binding
end

#locationObject (readonly)

Returns the value of attribute location.



6
7
8
# File 'lib/saml/kit/bindings/binding.rb', line 6

def location
  @location
end

Instance Method Details

#==(other) ⇒ Object



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

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

#binding?(other) ⇒ Boolean

Returns:

  • (Boolean)


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

def binding?(other)
  binding == other
end

#deserialize(_params) ⇒ Object

Raises:

  • (ArgumentError)


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

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

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


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

def eql?(other)
  self == other
end

#hashObject



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

def hash
  to_s.hash
end

#inspectObject



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

def inspect
  to_h.inspect
end

#serializeObject



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

def serialize(*)
  []
end

#to_hObject



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

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

#to_sObject



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

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