module LiveJournal::Sync::CommentsXML
Constants
- Parser
Public Class Methods
load_comment_from_attrs(comment, attrs)
click to toggle source
# File lib/livejournal/comments-xml.rb, line 47 def self.load_comment_from_attrs(comment, attrs) comment.commentid = attrs['id'].to_i comment.posterid = CommentsXML::optional_int_string attrs['posterid'] comment.itemid = CommentsXML::optional_int_string attrs['jitemid'] comment.parentid = CommentsXML::optional_int_string attrs['parentid'] statestr = attrs['state'] comment.state = LiveJournal::Comment::state_from_string(statestr) if statestr end
optional_int_string(x)
click to toggle source
# File lib/livejournal/comments-xml.rb, line 42 def self.optional_int_string(x) return nil unless x x.to_i end