Sha256: e4197e810058c87e0b42921b2b82932492427f84a5b23102d72bc140156fb41c
Contents?: true
Size: 918 Bytes
Versions: 17
Compression:
Stored size: 918 Bytes
Contents
module GoogleApps module Atom class PublicKey def initialize @document = Atom::XML::Document.new add_header end # new_key adds the actual key to the PublicKey # XML document. # # new_key 'key' # # new_key returns @document.root def new_key(key) property = Atom::XML::Node.new('apps:property') property['name'] = 'publicKey' property['value'] = Base64.encode64 key @document.root << property end # to_s returns @document as a String def to_s @document.to_s end private def add_header @document.root = Atom::XML::Node.new('atom:entry') Atom::XML::Namespace.new(@document.root, 'atom', 'http://www.w3.org/2005/Atom') Atom::XML::Namespace.new(@document.root, 'apps', 'http://schemas.google.com/apps/2006') end end end end
Version data entries
17 entries across 17 versions & 1 rubygems