Adds `asObject` function.
The spec says that an Activity may be used as on Object. This adds a function
that just does a type cast to support that.
Jesse Hallett
10 years ago
57 | 57 | , acVerb |
58 | 58 | , acRest |
59 | 59 | , makeActivity |
60 | , asObject | |
60 | 61 | -- * Collection |
61 | 62 | , Collection |
62 | 63 | , cTotalItems |
231 | 232 | $ HM.insert "published" (toJSON published) |
232 | 233 | $ HM.empty |
233 | 234 | |
235 | -- | JSON Activity Streams 1.0 specificies that an @Activity@ may be used as an | |
236 | -- @Object@. In such a case, the object may have fields permitted on either an | |
237 | -- @Activity@ or an @Object@ | |
238 | asObject :: Activity -> Object | |
239 | asObject act = Object (fromActivity act) | |
240 | ||
234 | 241 | -- | Collection |
235 | 242 | |
236 | 243 | data Collection = Collection { fromCollection :: A.Object } deriving (Eq, Show) |