<aside> 👉 Links (Property base class)

ButtonProperty

CheckboxProperty

CreatedByProperty

CreatedTimeProperty

DateProperty

EmailProperty

FilesProperty

FormulaProperty

MultiSelectProperty

LastEditedByProperty

LastEditedTimeProperty

NumberProperty

PeopleProperty

PhoneNumberProperty

Property

RelationProperty

RichTextProperty

RollupProperty

SelectProperty

StatusProperty

TitleProperty

UniqueIdProperty

UrlProperty

VerificationProperty

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

checkbox → Boolean, Hash

  1. checkbox of Page property returns the boolean property values of the page.

  2. checkbox of Database or DataSource property returns the schema Hash. For Checkbox property, it is an empty Hash {}.

    page.properties["CheckboxTitle"].checkbox
    # => true
    ds.properties["CheckboxTitle"].checkbox
    # => {}
    

[P] checkbox=(value)

  1. checkbox=(value) of Page property sets the boolean property value of the page and sets will_update_flag to true.

  2. Set true or false as value. Checkbox property cannot be set to nil; use false when the checkbox is unchecked.

  3. checkbox=(value) of Database or DataSource property raises StandardError.

    page.properties["CheckboxTitle"].checkbox = true
    # => true
    
    page.properties["CheckboxTitle"].checkbox = false
    # => false
    
    ds.properties["CheckboxTitle"].checkbox = true
    # ...:in `assert_page_property': checkbox= can execute only Page property. (StandardError)
    

filter_does_not_equal(value) → Query

Creates a Query for checkbox values that differ from value. The returned Query's filter contains the property name, checkbox type, does_not_equal operator, and the supplied boolean.

ds.properties["Done"].filter_does_not_equal(true).filter
# => {"property" => "Done", "checkbox" => {"does_not_equal" => true}}

Creating the Query does not send an API request or change the checkbox value. The method does not validate the argument's type. For ordinary checkbox filters, omit condition: and another_type:; these optional keywords support nested filters.

filter_equals(value) → Query

Creates a Query for checkbox values that match value. The returned Query's filter contains the property name, checkbox type, equals operator, and the supplied boolean.

ds.properties["Done"].filter_equals(false).filter
# => {"property" => "Done", "checkbox" => {"equals" => false}}