Class: SamlTool::Encoder
- Inherits:
-
Object
- Object
- SamlTool::Encoder
- Defined in:
- lib/saml_tool/encoder.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
- #encode ⇒ Object
-
#initialize(saml) ⇒ Encoder
constructor
A new instance of Encoder.
- #zlib ⇒ Object
Constructor Details
#initialize(saml) ⇒ Encoder
11 12 13 14 |
# File 'lib/saml_tool/encoder.rb', line 11 def initialize(saml) @saml = saml @output = @saml.clone end |
Instance Attribute Details
#output ⇒ Object
Returns the value of attribute output.
5 6 7 |
# File 'lib/saml_tool/encoder.rb', line 5 def output @output end |
#saml ⇒ Object (readonly)
Returns the value of attribute saml.
4 5 6 |
# File 'lib/saml_tool/encoder.rb', line 4 def saml @saml end |
Class Method Details
.encode(saml) ⇒ Object
7 8 9 |
# File 'lib/saml_tool/encoder.rb', line 7 def self.encode(saml) new(saml).encode end |
Instance Method Details
#base64 ⇒ Object
22 23 24 |
# File 'lib/saml_tool/encoder.rb', line 22 def base64 self.output = Base64.encode64 output end |
#encode ⇒ Object
16 17 18 19 20 |
# File 'lib/saml_tool/encoder.rb', line 16 def encode zlib base64 output end |
#zlib ⇒ Object
26 27 28 |
# File 'lib/saml_tool/encoder.rb', line 26 def zlib self.output = Zlib::Deflate.deflate(output, Zlib::BEST_COMPRESSION)[2..-5] end |