<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>
email of Page property returns the email address value.
email of Page property returns nil when the email address is empty.
email of Database or DataSource property returns the schema Hash. For Email property, it is an empty Hash {}.
page.properties["MailTitle"].email
# => "[email protected]"
page.properties["MailTitle"].email
# => nil
ds.properties["MailTitle"].email
# => {}
String), or nil to clear the valueemail=(value) of Page property sets the email address value and sets will_update_flag to true.
email = nil clears the email address value.
email = "" keeps an empty string as-is. It is not converted to nil by NotionRubyMapping.
email=(value) of Database or DataSource property raises StandardError.
page.properties["MailTitle"].email = "[email protected]"
# => "[email protected]"
page.properties["MailTitle"].email = nil
# => nil
page.properties["MailTitle"].email = ""
# => ""
ds.properties["MailTitle"].email = "[email protected]"
# ...:in `assert_page_property': email= can execute only Page property. (StandardError)
The methods below return a Query without sending an API request or changing the email value. They are available on Page, Database and DataSource property objects; query examples use DataSource properties. The examples show the generated Hash through Query#filter, not search results.
For ordinary Email filters, omit condition: and another_type: (both default to nil). The shared implementation accepts them for Formula / Rollup use, but they are not needed for an Email condition. Use filter_is_empty / filter_is_not_empty for empty-value searches rather than passing nil as a string comparison value.
Creates a Query that matches email addresses containing the given substring.
String; the email address or substring to compare.ds.properties["MailTitle"].filter_contains("example").filter
# => {"property" => "MailTitle", "email" => {"contains" => "example"}}