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

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

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.



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

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

Instance Attribute Details

#binding ⇒ Object (readonly)

Returns the value of attribute binding.



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

def binding
  @binding
end

#location ⇒ Object (readonly)

Returns the value of attribute location.



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

def location
  @location
end

Instance Method Details

#==(other) ⇒ Object



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

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

#binding?(other) ⇒ Boolean

Returns:

  • (Boolean)


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

def binding?(other)
  binding == other
end

#deserialize(params) ⇒ Object

Raises:

  • (ArgumentError)


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

def deserialize(params)
  raise ArgumentError.new("Unsupported binding")
end

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


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

def eql?(other)
  self == other
end

#hash ⇒ Object



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

def hash
  to_s.hash
end

#inspect ⇒ Object



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

def inspect
  to_h.inspect
end

#serialize(builder, relay_state: nil) ⇒ Object



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

def serialize(builder, relay_state: nil)
  []
end

#to_h ⇒ Object



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

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

#to_s ⇒ Object



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

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