Class: Twitter::DirectMessage
- Inherits:
-
Object
- Object
- Twitter::DirectMessage
- Includes:
- EasyClassMaker
- Defined in:
- lib/twitter/direct_message.rb
Class Method Summary collapse
-
.new_from_xml(xml) ⇒ Object
Creates a new status from a piece of xml.
Methods included from EasyClassMaker
Class Method Details
.new_from_xml(xml) ⇒ Object
Creates a new status from a piece of xml
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/twitter/direct_message.rb', line 9 def new_from_xml(xml) DirectMessage.new do |d| d.id = (xml).at('id').innerHTML d.text = (xml).get_elements_by_tag_name('text').innerHTML d.sender_id = (xml).at('sender_id').innerHTML d.recipient_id = (xml).at('recipient_id').innerHTML d.created_at = (xml).at('created_at').innerHTML d.sender_screen_name = (xml).at('sender_screen_name').innerHTML d.recipient_screen_name = (xml).at('recipient_screen_name').innerHTML end end |