aboutsummaryrefslogtreecommitdiff
path: root/src/feednim/atom.nim
diff options
context:
space:
mode:
authorJohn Conway <john.a.conway@gmail.com>2019-05-09 22:13:26 +0100
committerJohn Conway <john.a.conway@gmail.com>2019-05-09 22:13:26 +0100
commit9fc335c6aebfcb83b8cf6be354f169a237920ad0 (patch)
treee53cd4391c5dec0baab1fb91475d8cd418e25e28 /src/feednim/atom.nim
parent7b132fd2d4afa0cf7e795398d93a3637bd9b8282 (diff)
downloadfeed-nim-9fc335c6aebfcb83b8cf6be354f169a237920ad0.tar.gz
feed-nim-9fc335c6aebfcb83b8cf6be354f169a237920ad0.zip
[RSS] Added Tests, fixes, rewrites
Diffstat (limited to 'src/feednim/atom.nim')
-rw-r--r--src/feednim/atom.nim15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/feednim/atom.nim b/src/feednim/atom.nim
index 431bd5e..a432844 100644
--- a/src/feednim/atom.nim
+++ b/src/feednim/atom.nim
@@ -12,7 +12,7 @@ import streams
import sugar
type
- AtomCommon = ref object of RootObj
+ AtomCommon = ref object of RootObj # These properties aren't gathered yet
xmlbase*: string
xmllang*: string
@@ -92,7 +92,7 @@ type
# Promotes text node to the top of an AtomText object if caller expects a string
-converter toString*(obj: AtomText): string =
+converter atomToString*(obj: AtomText): string =
return obj.text
@@ -250,16 +250,13 @@ proc parseAtom* ( data: string ): Atom =
else:
atom.author = AtomAuthor()
- # If there are no entries:
- if node.child("entry") == nil:
+
+ if node.child("entry") == nil: # If there are no entries:
atom.entries = @[]
return atom
- # Otherwise, add the entries.
- if node.child("entry") != nil:
+ if node.child("entry") != nil: # Otherwise, add the entries.
atom.entries = map( node.findAll("entry"), parseEntry )
# Return the Atom data.
- return atom
-
-
+ return atom \ No newline at end of file