<aside> 👉 Links (Property base class)
Notion Ruby Mapping Public API Reference
</aside>
Returns the rich text object at the given index, or nil if the index is out of range. num is an integer index; negative indexes count from the end.
page.properties["Title"][0]
# => #<NotionRubyMapping::TextObject:...>
Appends a rich text object and marks the property for update. to is a String or RichTextObject. A String is converted to a TextObject; an existing RichTextObject is used directly. Returns the object that was added. This operation does not itself save the page.
ptp = page.properties["Title"]
ptp << "Added text"
# => #<NotionRubyMapping::TextObject:...>
[P] self.each → Enumerator
With a block, yields each RichTextObject and returns the underlying Array, not the TitleProperty. Without a block, returns an Enumerator. Enumerable methods are also available.
ptp = page.properties["Title"]
ptp.map(&:text)
# => ["MNO"]
These methods return a Query; .filter in the examples reads its generated Hash. Creating a condition does not send an API request or update the property value.
For ordinary title filters, omit condition: and another_type:. The shared methods accept these keywords for nested Formula / Rollup conditions; they are not needed for the examples below. The filter methods do not validate or normalize the supplied string.
Creates a Query object whose title condition matches a value that contains the given string. The value argument is a String and is passed to the filter unchanged.
ds.properties["Title"].filter_contains("Notion").filter
# => {"property" => "Title", "title" => {"contains" => "Notion"}}
Creates a Query object whose title condition matches a value that does not contain the given string. The value argument is a String and is passed to the filter unchanged.
ds.properties["Title"].filter_does_not_contain("draft").filter
# => {"property" => "Title", "title" => {"does_not_contain" => "draft"}}