Class: GoogleApps::Atom::GroupOwner

Inherits:
Document
  • Object
show all
Defined in:
lib/google_apps/atom/group_owner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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, #to_s, #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

#initialize(xml = nil) ⇒ GroupOwner

Returns a new instance of GroupOwner.



6
7
8
9
# File 'lib/google_apps/atom/group_owner.rb', line 6

def initialize(xml = nil)
  super(xml)
  xml ? attrs_from_props : @doc.root = build_root(:group)
end

Instance Attribute Details

#addressObject

Returns the value of attribute address.



4
5
6
# File 'lib/google_apps/atom/group_owner.rb', line 4

def address
  @address
end

Instance Method Details

#add_address(address) ⇒ Object

Parameters:

  • address (String)

    email address of the owner object.

Returns:



17
18
19
20
# File 'lib/google_apps/atom/group_owner.rb', line 17

def add_address(address)
  add_prop_node('email', address)
  @doc = parse @doc
end

#update_address(address) ⇒ Object



23
24
25
26
# File 'lib/google_apps/atom/group_owner.rb', line 23

def update_address(address)
  find_and_update '//apps:property', { name: ['email', 'email'], value: [@address, address] }
  @doc = parse @doc
end