Class: MingleEvents::Feed::Author

Inherits:
Object
  • Object
show all
Defined in:
lib/mingle_events/feed/author.rb

Overview

The user who’s Mingle activity triggered this event

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(author_element) ⇒ Author

Returns a new instance of Author.



16
17
18
19
20
21
# File 'lib/mingle_events/feed/author.rb', line 16

def initialize(author_element)
  @name = author_element.inner_text("./atom:name")
  @email = author_element.optional_inner_text("./atom:email")
  @uri = author_element.optional_inner_text("./atom:uri")
  @icon_uri = author_element.optional_inner_text("./mingle:icon")
end

Instance Attribute Details

#emailObject (readonly)

The email address of the author



10
11
12
# File 'lib/mingle_events/feed/author.rb', line 10

def email
  @email
end

#icon_uriObject (readonly)

The URI for the author’s icon



14
15
16
# File 'lib/mingle_events/feed/author.rb', line 14

def icon_uri
  @icon_uri
end

#nameObject (readonly)

The name of the author



8
9
10
# File 'lib/mingle_events/feed/author.rb', line 8

def name
  @name
end

#uriObject (readonly)

The URI identifying the author as well as location of his profile data



12
13
14
# File 'lib/mingle_events/feed/author.rb', line 12

def uri
  @uri
end

Class Method Details

.from_snippet(author_xml) ⇒ Object



23
24
25
# File 'lib/mingle_events/feed/author.rb', line 23

def self.from_snippet(author_xml)
  self.new(Xml.parse(author_xml, ATOM_AND_MINGLE_NS).select("/atom:author"))
end