Class: GoogleApps::Atom::PublicKey
- Defined in:
- lib/google_apps/atom/public_key.rb
Instance Attribute Summary collapse
-
#doc ⇒ Object
readonly
Returns the value of attribute doc.
Instance Method Summary collapse
-
#initialize ⇒ PublicKey
constructor
A new instance of PublicKey.
-
#new_key(key) ⇒ Object
new_key adds the actual key to the PublicKey XML document.
-
#to_s ⇒ Object
to_s returns @doc as a String.
Methods inherited from Document
add_type, #attrs_from_props, #build_root, #delete_node, #determine_namespaces, #find_and_update, #find_values, inherited, #make_document, #new_empty_doc, #parse, #set_instances, sub_to_meth, #type_to_s, #type_to_sym, types
Methods included from Node
#add_attributes, #add_namespaces, #add_prop_node, #check_value, #create_node, #get_content, #get_values, #node_match?
Constructor Details
Instance Attribute Details
#doc ⇒ Object (readonly)
Returns the value of attribute doc.
4 5 6 |
# File 'lib/google_apps/atom/public_key.rb', line 4 def doc @doc end |
Instance Method Details
#new_key(key) ⇒ Object
new_key adds the actual key to the PublicKey XML document.
new_key ‘key’
new_key returns @doc.root
17 18 19 20 21 22 23 |
# File 'lib/google_apps/atom/public_key.rb', line 17 def new_key(key) property = Atom::XML::Node.new('apps:property') property['name'] = 'publicKey' property['value'] = Base64.encode64 key @doc.root << property end |
#to_s ⇒ Object
to_s returns @doc as a String
26 27 28 |
# File 'lib/google_apps/atom/public_key.rb', line 26 def to_s @doc.to_s end |