Module: LiveJournal::Sync::CommentsXML
- Defined in:
- lib/livejournal/comments-xml.rb
Defined Under Namespace
Classes: Base, WithExpat, WithREXML
Constant Summary
collapse
- Parser =
WithREXML
Class Method Summary
collapse
Class Method Details
47
48
49
50
51
52
53
54
|
# File 'lib/livejournal/comments-xml.rb', line 47
def self.(, attrs)
. = attrs['id'].to_i
.posterid = ::optional_int_string attrs['posterid']
.itemid = ::optional_int_string attrs['jitemid']
.parentid = ::optional_int_string attrs['parentid']
statestr = attrs['state']
.state = LiveJournal::::state_from_string(statestr) if statestr
end
|
.optional_int_string(x) ⇒ Object
42
43
44
45
|
# File 'lib/livejournal/comments-xml.rb', line 42
def self.optional_int_string(x)
return nil unless x
x.to_i
end
|