Skip to content

Commit

Permalink
Extend docs
Browse files Browse the repository at this point in the history
  • Loading branch information
svenvc committed Oct 24, 2023
1 parent 45e6304 commit d70b6df
Show file tree
Hide file tree
Showing 3 changed files with 177 additions and 11 deletions.
87 changes: 82 additions & 5 deletions lepiter/81brlbrknhsro4cxzdl06l22t.bak
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@
"__type" : "time",
"time" : {
"__type" : "dateAndTime",
"dateAndTimeString" : "2023-10-23T15:01:16.025958+02:00"
"dateAndTimeString" : "2023-10-24T11:06:23.066158+02:00"
}
},
"uid" : {
Expand Down Expand Up @@ -269,6 +269,83 @@
"previewExpanded" : false,
"noCode" : false
},
{
"__type" : "textSnippet",
"children" : {
"__type" : "snippets",
"items" : [ ]
},
"createEmail" : {
"__type" : "email",
"emailString" : "<unknown>"
},
"createTime" : {
"__type" : "time",
"time" : {
"__type" : "dateAndTime",
"dateAndTimeString" : "2023-10-24T10:52:41.800972+02:00"
}
},
"editEmail" : {
"__type" : "email",
"emailString" : "<unknown>"
},
"editTime" : {
"__type" : "time",
"time" : {
"__type" : "dateAndTime",
"dateAndTimeString" : "2023-10-24T11:08:17.241982+02:00"
}
},
"uid" : {
"__type" : "uid",
"uidString" : "dVXPMtTEDQC1y38DBchSng=="
},
"paragraphStyle" : {
"__type" : "textStyle"
},
"string" : "{{gtClass:NeoJSONObject}} is a subclass of OrderedDictionary which automatically implements accessors using key access. When a key does not exist, nil is returned instead of a {{gtClass:KeyNotFound}} being raised."
},
{
"__type" : "exampleSnippet",
"children" : {
"__type" : "snippets",
"items" : [ ]
},
"createEmail" : {
"__type" : "email",
"emailString" : "<unknown>"
},
"createTime" : {
"__type" : "time",
"time" : {
"__type" : "dateAndTime",
"dateAndTimeString" : "2023-10-24T11:16:16.219788+02:00"
}
},
"editEmail" : {
"__type" : "email",
"emailString" : "<unknown>"
},
"editTime" : {
"__type" : "time",
"time" : {
"__type" : "dateAndTime",
"dateAndTimeString" : "2023-10-24T11:16:16.219788+02:00"
}
},
"uid" : {
"__type" : "uid",
"uidString" : "Vq4dh9TEDQC8hjUdBchSng=="
},
"exampleSelector" : "exampleSimpleUsage",
"previewHeight" : 200,
"previewShowSelector" : "gtViewsFor:",
"exampleBehaviorName" : "NeoJSONObject class",
"codeExpanded" : true,
"previewExpanded" : false,
"noCode" : false
},
{
"__type" : "textSnippet",
"children" : {
Expand All @@ -294,7 +371,7 @@
"__type" : "time",
"time" : {
"__type" : "dateAndTime",
"dateAndTimeString" : "2023-10-23T14:58:50.307554+02:00"
"dateAndTimeString" : "2023-10-24T11:21:09.587872+02:00"
}
},
"uid" : {
Expand All @@ -304,7 +381,7 @@
"paragraphStyle" : {
"__type" : "textStyle"
},
"string" : "Let's see. One convenient way to parse this is to use NeoJSONObject class>>#fromString."
"string" : "One convenient way to parse JSON is to use {{gtMethod: NeoJSONObject class>>#fromString:}}."
},
{
"__type" : "exampleSnippet",
Expand Down Expand Up @@ -371,7 +448,7 @@
"__type" : "time",
"time" : {
"__type" : "dateAndTime",
"dateAndTimeString" : "2023-10-23T14:59:48.738683+02:00"
"dateAndTimeString" : "2023-10-24T10:52:03.553046+02:00"
}
},
"uid" : {
Expand All @@ -381,7 +458,7 @@
"paragraphStyle" : {
"__type" : "textStyle"
},
"string" : "The inverse operation, from an object to JSON is also convenient, given it is a NeoJSONObject."
"string" : "The inverse operation, from an object to JSON is also convenient, given it is a {{gtClass:NeoJSONObject}} whose {{gtMethod: NeoJSONObject>>#printOn:}} outputs JSON."
},
{
"__type" : "exampleSnippet",
Expand Down
89 changes: 83 additions & 6 deletions lepiter/81brlbrknhsro4cxzdl06l22t.lepiter
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
},
"exampleSelector" : "exampleSimpleJSON",
"previewHeight" : 200,
"previewShowSelector" : "gtViewsFor:",
"previewShowSelector" : "gtStringFor:",
"exampleBehaviorName" : "NeoJSONObject class",
"codeExpanded" : true,
"previewExpanded" : false,
Expand Down Expand Up @@ -217,7 +217,7 @@
"__type" : "time",
"time" : {
"__type" : "dateAndTime",
"dateAndTimeString" : "2023-10-23T15:01:16.025958+02:00"
"dateAndTimeString" : "2023-10-24T11:06:23.066158+02:00"
}
},
"uid" : {
Expand Down Expand Up @@ -269,6 +269,83 @@
"previewExpanded" : false,
"noCode" : false
},
{
"__type" : "textSnippet",
"children" : {
"__type" : "snippets",
"items" : [ ]
},
"createEmail" : {
"__type" : "email",
"emailString" : "<unknown>"
},
"createTime" : {
"__type" : "time",
"time" : {
"__type" : "dateAndTime",
"dateAndTimeString" : "2023-10-24T10:52:41.800972+02:00"
}
},
"editEmail" : {
"__type" : "email",
"emailString" : "<unknown>"
},
"editTime" : {
"__type" : "time",
"time" : {
"__type" : "dateAndTime",
"dateAndTimeString" : "2023-10-24T11:08:17.241982+02:00"
}
},
"uid" : {
"__type" : "uid",
"uidString" : "dVXPMtTEDQC1y38DBchSng=="
},
"paragraphStyle" : {
"__type" : "textStyle"
},
"string" : "{{gtClass:NeoJSONObject}} is a subclass of OrderedDictionary which automatically implements accessors using key access. When a key does not exist, nil is returned instead of a {{gtClass:KeyNotFound}} being raised."
},
{
"__type" : "exampleSnippet",
"children" : {
"__type" : "snippets",
"items" : [ ]
},
"createEmail" : {
"__type" : "email",
"emailString" : "<unknown>"
},
"createTime" : {
"__type" : "time",
"time" : {
"__type" : "dateAndTime",
"dateAndTimeString" : "2023-10-24T11:16:16.219788+02:00"
}
},
"editEmail" : {
"__type" : "email",
"emailString" : "<unknown>"
},
"editTime" : {
"__type" : "time",
"time" : {
"__type" : "dateAndTime",
"dateAndTimeString" : "2023-10-24T11:16:16.219788+02:00"
}
},
"uid" : {
"__type" : "uid",
"uidString" : "Vq4dh9TEDQC8hjUdBchSng=="
},
"exampleSelector" : "exampleSimpleUsage",
"previewHeight" : 200,
"previewShowSelector" : "gtViewsFor:",
"exampleBehaviorName" : "NeoJSONObject class",
"codeExpanded" : true,
"previewExpanded" : false,
"noCode" : false
},
{
"__type" : "textSnippet",
"children" : {
Expand All @@ -294,7 +371,7 @@
"__type" : "time",
"time" : {
"__type" : "dateAndTime",
"dateAndTimeString" : "2023-10-23T15:01:32.987758+02:00"
"dateAndTimeString" : "2023-10-24T11:21:09.587872+02:00"
}
},
"uid" : {
Expand All @@ -304,7 +381,7 @@
"paragraphStyle" : {
"__type" : "textStyle"
},
"string" : "Let's see. One convenient way to parse JSON is to use NeoJSONObject class>>#fromString."
"string" : "One convenient way to parse JSON is to use {{gtMethod: NeoJSONObject class>>#fromString:}}."
},
{
"__type" : "exampleSnippet",
Expand Down Expand Up @@ -371,7 +448,7 @@
"__type" : "time",
"time" : {
"__type" : "dateAndTime",
"dateAndTimeString" : "2023-10-23T14:59:48.738683+02:00"
"dateAndTimeString" : "2023-10-24T10:52:03.553046+02:00"
}
},
"uid" : {
Expand All @@ -381,7 +458,7 @@
"paragraphStyle" : {
"__type" : "textStyle"
},
"string" : "The inverse operation, from an object to JSON is also convenient, given it is a NeoJSONObject."
"string" : "The inverse operation, from an object to JSON is also convenient, given it is a {{gtClass:NeoJSONObject}} whose {{gtMethod: NeoJSONObject>>#printOn:}} outputs JSON."
},
{
"__type" : "exampleSnippet",
Expand Down
12 changes: 12 additions & 0 deletions repository/Neo-JSON-Core/NeoJSONObject.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,18 @@ NeoJSONObject class >> exampleSimpleParsing [
^ result
]

{ #category : #example }
NeoJSONObject class >> exampleSimpleUsage [
<gtExample>
| simple |
simple := NeoJSONObject exampleSimple.
self assert: simple foo equals: (simple at: #foo).
self assert: (simple foo: -1) equals: (simple at: #foo put: -1; yourself).
self assert: (simple includesKey: #baz) not.
self assert: simple baz equals: nil.
^ simple
]

{ #category : #example }
NeoJSONObject class >> exampleSimpleWriting [
<gtExample>
Expand Down

0 comments on commit d70b6df

Please sign in to comment.