Class: SamlTool::Decoder
- Inherits:
-
Object
- Object
- SamlTool::Decoder
- Defined in:
- lib/saml_tool/decoder.rb
Instance Attribute Summary collapse
-
#output ⇒ Object
Returns the value of attribute output.
-
#saml ⇒ Object
readonly
Returns the value of attribute saml.
Class Method Summary collapse
Instance Method Summary collapse
- #base64 ⇒ Object
- #decode ⇒ Object
-
#initialize(encoded_saml) ⇒ Decoder
constructor
A new instance of Decoder.
- #zlib ⇒ Object
Constructor Details
#initialize(encoded_saml) ⇒ Decoder
Returns a new instance of Decoder.
11 12 13 14 |
# File 'lib/saml_tool/decoder.rb', line 11 def initialize(encoded_saml) @saml = encoded_saml @output = @saml.clone end |
Instance Attribute Details
#output ⇒ Object
Returns the value of attribute output.
5 6 7 |
# File 'lib/saml_tool/decoder.rb', line 5 def output @output end |
#saml ⇒ Object (readonly)
Returns the value of attribute saml.
4 5 6 |
# File 'lib/saml_tool/decoder.rb', line 4 def saml @saml end |
Class Method Details
.decode(encoded_saml) ⇒ Object
7 8 9 |
# File 'lib/saml_tool/decoder.rb', line 7 def self.decode(encoded_saml) new(encoded_saml).decode end |
Instance Method Details
#base64 ⇒ Object
22 23 24 |
# File 'lib/saml_tool/decoder.rb', line 22 def base64 self.output = Base64.decode64 output end |
#decode ⇒ Object
16 17 18 19 20 |
# File 'lib/saml_tool/decoder.rb', line 16 def decode base64 zlib output end |
#zlib ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/saml_tool/decoder.rb', line 26 def zlib zstream = Zlib::Inflate.new(-Zlib::MAX_WBITS) # I have no idea why we're using minus Zlib::MAX_WBITS. Zlib documentation suggests just Zlib::MAX_WBITS should work, but it doesn't self.output = zstream.inflate(output) zstream.finish zstream.close return output end |