Class: GoogleApps::Atom::Nickname

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

Constant Summary collapse

MAP =
{
  name: :nickname,
  userName: :user
}

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, #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) ⇒ Nickname

Returns a new instance of Nickname.



11
12
13
14
# File 'lib/google_apps/atom/nickname.rb', line 11

def initialize(xml = nil)
  super(xml, MAP)
  @doc.root = build_root(:nickname) unless xml
end

Instance Attribute Details

#docObject (readonly)

Returns the value of attribute doc.



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

def doc
  @doc
end

#nicknameObject

Returns the value of attribute nickname.



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

def nickname
  @nickname
end

#userObject

Returns the value of attribute user.



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

def user
  @user
end

Instance Method Details

#to_sObject

to_s returns the underlying XML document as a string.



44
45
46
# File 'lib/google_apps/atom/nickname.rb', line 44

def to_s
  @doc.to_s
end