Persistance: Object Database mapper.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2022-04-05 15:30:52 -05:00
parent 128c557d2f
commit d23211abbc
5 changed files with 15 additions and 5 deletions

View File

@ -19,5 +19,6 @@ getMessages
current queries add: customQuery.
lastTweets add: current.
].
^ lastTweets
self tweets: lastTweets.
^ self tweets

View File

@ -1,8 +1,9 @@
accessing
reStoreDefinition
^ super reStoreDefinition
define: #id as: String;
defineAsID: #id;
define: #text as: String;
define: #created as: String;
defineAsID: #id;
define: #user as: TwitterUser;
define: #timelines as: (Dictionary of: String -> String);
yourself

View File

@ -2,4 +2,4 @@ accessing
timelines
"A dictionary of several the timelines where this tweet appears.
The key is the user's timeline and the value is the message id before this particular message appears in such user's timeline."
^ self metadata at: 'timelines' ifAbsentPut: [ Dictionary new ].
^ timelines ifNil: [ timelines := Dictionary new ].

View File

@ -13,7 +13,8 @@
"conversationId",
"user",
"metadata",
"metrics"
"metrics",
"timelines"
],
"name" : "Tweet",
"type" : "normal"

View File

@ -0,0 +1,7 @@
accessing
reStoreDefinition
^ super reStoreDefinition
define: #id as: String;
define: #userName as: String;
define: #profileImageUrl as: String;
yourself.