<aside> 👉 Links (Property base class)

CheckboxProperty

DateProperty

FormulaProperty

MultiSelectProperty

PhoneNumberProperty

RollupProperty

TitleProperty

CreatedByProperty

EmailProperty

LastEditedByProperty

NumberProperty

RelationProperty 🚧

SelectProperty

UrlProperty

CreatedTimeProperty

FilesProperty

LastEditedTimeProperty

PeopleProperty

RichTextProperty

StatusProperty

Notion Ruby Mapping Public API Reference

</aside>

<aside> 💡

[P] means methods for Page Property, [DB/DS] means methods for Database or DataSource Property.

</aside>

1. Instance methods

[P/DB/DS] people → Array<UserObject>, Hash

people returns the people assigned to this property.

  1. For a Page property, people returns an array of UserObject instances.
  2. For a Database or DataSource property, 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")

[P] add_person(user_id_or_uo)

add_person adds one user to this people property.

This method marks the property as changed. It does not remove duplicate users.

  1. add_person of Page property adds a UserObject generated from user_id, or a parameter UserObject.
  2. 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)

filter_contains(value) → Query