<aside> 👉 Links (Property base class)
Notion Ruby Mapping Public API Reference
</aside>
<aside> 💡
[P] means methods for Page Property, [DB/DS] means methods for Database or DataSource Property.
</aside>
people returns the people assigned to this property.
people returns an array of UserObject instances.people returns the schema payload.Treat the returned array as read-only for update operations. Do not modify it directly with methods such as <<. Use people= or add_person to update the property so that it is marked as changed.
page.properties["UserTitle"].people
# => [#<NotionRubyMapping::UserObject:...>]
db.properties["UserTitle"].people
# => {}
ds.properties["UserTitle"].people
# => {}
# Do not use this as the official update API.
page.properties["UserTitle"].people << user_object
Use these methods instead.
page.properties["UserTitle"].people = ["a_user_id", "b_user_id"]
page.properties["UserTitle"].add_person("c_user_id")
add_person adds one user to this people property.
This method marks the property as changed. It does not remove duplicate users.
add_person of Page property adds a UserObject generated from user_id, or a parameter UserObject.add_person of Database or DataSource property raises StandardError.page.properties["UserTitle"].add_person "a_user_id"
# => [#<NotionRubyMapping::UserObject:...>, #<NotionRubyMapping::UserObject:...>]
page.properties["UserTitle"].add_person UserObject.user_object("a_user_id")
# => [#<NotionRubyMapping::UserObject:...>, #<NotionRubyMapping::UserObject:...>]
db.properties["UserTitle"].add_person "a_user_id"
# => ...in `assert_page_property': add_person can execute only Page property. (StandardError)
ds.properties["UserTitle"].add_person "a_user_id"
# => ...in `assert_page_property': add_person can execute only Page property. (StandardError)