Skip to content

Commit

Permalink
Update use of property to attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason2605 committed Aug 20, 2023
1 parent c955b8b commit c103173
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions docs/docs/classes.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ print(myObject.x); // 10
Attempting to access an attribute of an object that does not exist will throw a runtime error, and instead before accessing an attribute that may not be there, you should check
if the object has the given attribute. This is done via `hasAttribute`.

Note: Will only check properties with public visibility.
Note: Will only check attributes with public visibility.

```cs
class Test {
Expand All @@ -231,7 +231,7 @@ print(myObject.z); // Undefined attribute 'z'.
Sometimes in Dictu we may wish to access an attribute of an object without knowing the attribute until runtime. We can do this via the `getAttribute` method.
This method takes a string and an optional default value and returns either the attribute value or the default value (if there is no attribute and no default value, nil is returned).

Note: Will only retrieve properties with public visibility.
Note: Will only retrieve attributes with public visibility.

```cs
class Test {
Expand All @@ -249,7 +249,7 @@ print(myObject.getAttribute("y")); // nil

### getAttributes() -> Dict

The `getAttributes` method returns all class variables / constants, public methods and public properties.
The `getAttributes` method returns all class variables / constants, public methods and public attributes.

```cs
class Test {
Expand All @@ -259,7 +259,7 @@ class Test {
}

var myObject = Test();
print(myObject.getAttributes()); // {"fields": [], "methods": ["init"], "attributes": ["_class", "x"]}
print(myObject.getAttributes()); // {"fields": ["_name"], "methods": ["init"], "attributes": ["_class", "x"]}
```

### setAttribute(String, Value)
Expand Down Expand Up @@ -674,7 +674,7 @@ class ClassWithMethodAnnotation {
}
```
Annotations are access via the `.classAnnotations`, `.methodAnnotations` and `.fieldAnnotations` properties available on all classes.
Annotations are access via the `.classAnnotations`, `.methodAnnotations` and `.fieldAnnotations` attributes available on all classes.
For class annotations, the returned data structure returned is a dictionary with keys set to the names of the annotations and their values if present. If no value is provided to the annotation, the value associated with the key is set to `nil`.
Expand Down
12 changes: 6 additions & 6 deletions docs/docs/standard-lib/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,24 +93,24 @@ httpClient.post("https://httpbin.org/post", {"test": 10});
### Response

Both HTTP.get(), HTTP.post(), httpClient.get(), and httpClient.post() return a Result that unwraps a Response object on success, or nil on error.
The Response object returned has 3 public properties, "content", "headers" and "statusCode". "content" is the actual content returned from the
The Response object returned has 3 public attributes, "content", "headers" and "statusCode". "content" is the actual content returned from the
HTTP request as a string, "headers" is a list of all the response headers and "statusCode" is a number denoting the status code from
the response

#### Quick Reference Table
##### Properties
##### Attributes

| Property | Description |
| Attribute | Description |
| ---------- | ------------------------------------------------- |
| content | Raw string content returned from the HTTP request |
| headers | A list of headers returned from the HTTP request |
| statusCode | The status code returned from the HTTP request |

##### Methods

| Method | Description |
| ------ | ------------------------------------ |
| json | Convert the content property to JSON |
| Method | Description |
| ------ | ------------------------------------- |
| json | Convert the content attribute to JSON |

Example response from [httpbin.org](https://httpbin.org)

Expand Down

0 comments on commit c103173

Please sign in to comment.