Class: XML::XMLRPC::Builder::Base64

Inherits:
Object
  • Object
show all
Defined in:
lib/xml/libxml/xmlrpc/builder.rb

Overview

Base64 type class. The ‘Base64’ module that comes with ruby does not hold anything (it’s not a class), and since our parser depends on having the appropriate type to generate the right value clause, this is required for Base64 transfers.

Instance Method Summary collapse

Constructor Details

#initialize(str) ⇒ Base64

Takes a string.



129
130
131
# File 'lib/xml/libxml/xmlrpc/builder.rb', line 129

def initialize(str)
    @string = str
end

Instance Method Details

#encodeObject

Encodes the encapsulated string as Base64.



136
137
138
# File 'lib/xml/libxml/xmlrpc/builder.rb', line 136

def encode
    ::Base64.encode64(@string)
end