<aside> 👉 Links (Property base class)

CheckboxProperty

DateProperty

FormulaProperty

MultiSelectProperty

PhoneNumberProperty

RollupProperty

TitleProperty

CreatedByProperty

EmailProperty

CreatedTimeProperty

FilesProperty

LastEditedTimeProperty

PeopleProperty

RichTextProperty

StatusProperty

Notion Ruby Mapping Public API Reference

</aside>

<aside> ℹī¸ ↑ Table of Contents

</aside>

<aside> 💡 [P] means methods for Page Property, [D] means methods for Database Property.

</aside>

1. Instance methods

email → String, Hash

  1. email of Page property returns the email address.

  2. email of Database property returns an empty Hash {}.

    page.properties["MailTitle"].email
    # => "[email protected]"
    db.properties["MailTitle"].email
    # => {}
    

↑ Table of Contents

[P] email=(value)

  1. email=(value) of Page property sets the email address value and set will_update_flag to true.

  2. email=(value) of Database property raises StandardError.

    page.properties["MailTitle"].email = "[email protected]"
    # => "[email protected]"
    db.properties["MailTitle"].email = "[email protected]"
    # ...:in `assert_page_property': email= can execute only Page property. (StandardError)
    

filter_contains(value) → Query

filter_contains creates a Query object for contains filter.

db.properties["CreatedByTitle"].filter_contains "a_user_id"
# => #<NotionRubyMapping::Query:0x0000000110525498 @filter={"property"=>"CreatedByTitle", "created_by"=>{"contains"=>"a_user_id"}}, @page_size=100, @sort=[], @start_cursor=nil>

### only RollupProperty (none, any, every)
db.properties["RollupTitle"].filter_contains "abc", condition: "any", another_type: "rich_text"
# => #<NotionRubyMapping::Query:0x0000000105394f30 @filter={"property"=>"RollupTitle", "any"=>{"rich_text"=>{"contains"=>"abc"}}}, @page_size=100, @sort=[], @start_cursor=nil>

↑ Table of Contents

filter_does_not_contain(value) → Query

filter_does_not_contain creates a Query object for does_not_contain filter.

db.properties["CreatedByTitle"].filter_does_not_contain "a_user_id"
=> #<NotionRubyMapping::Query:0x0000000110666b68 @filter={"property"=>"CreatedByTitle", "created_by"=>{"does_not_contain"=>"a_user_id"}}, @page_size=100, @sort=[], @start_cursor=nil>

### only RollupProperty (none, any, every)
db.properties["CreatedByTitle"].filter_does_not_contain "abc", condition: "every", another_type: "people"
# => #<NotionRubyMapping::Query:0x000000010533e888 @filter={"property"=>"RollupTitle", "every"=>{"people"=>{"does_not_contain"=>"abc"}}}, @page_size=100, @sort=[], @start_cursor=nil>

↑ Table of Contents

filter_does_not_equal(value) → Query

filter_does_not_equal creates a Query object for does_not_equal filter.

db.properties["CheckboxTitle"].filter_does_not_equal true
# => #<NotionRubyMapping::Query:0x0000000110487680 @filter={"property"=>"CheckboxTitle", "checkbox"=>{"does_not_equal"=>true}}, @page_size=100, @sort=[], @start_cursor=nil>

db.created_time.filter_does_not_equal Date.new(2022, 5, 4)
# => #<NotionRubyMapping::Query:0x000000011052c928 @filter={"timestamp"=>"created_time", "created_time"=>{"does_not_equal"=>"2022-05-04"}}, @page_size=100, @sort=[], @start_cursor=nil>

### only RollupProperty (none, any, every)
db.properties["RollupTitle"].filter_does_not_equal "abc", condition: "every", another_type: "phone_number"
# => #<NotionRubyMapping::Query:0x00000001090d5430 @filter={"property"=>"RollupTitle", "every"=>{"phone_number"=>{"does_not_equal"=>"abc"}}}, @page_size=100, @sort=[], @start_cursor=nil>

### only RollupProperty (date)
db.properties["RollupTitle"].filter_does_not_equal Date.new(2022, 5, 7), another_type: "date"
# => #<NotionRubyMapping::Query:0x00000001090ff668 @filter={"property"=>"RollupTitle", "date"=>{"does_not_equal"=>"2022-05-07"}}, @page_size=100, @sort=[], @start_cursor=nil>

### only RollupProperty (number)
db.properties["RollupTitle"].filter_does_not_equal 100, another_type: "number"
# => #<NotionRubyMapping::Query:0x00000001090dc7f8 @filter={"property"=>"RollupTitle", "number"=>{"does_not_equal"=>100}}, @page_size=100, @sort=[], @start_cursor=nil>

↑ Table of Contents

filter_ends_with(str) → Query

filter_ends_with(str) creates a Query object for ends_with filter.

db.properties["MailTitle"].filter_ends_with "ac.jp"
=> #<NotionRubyMapping::Query:0x0000000105281b48 @filter={"property"=>"MailTitle", "email"=>{"ends_with"=>"ac.jp"}}, @page_size=100, @sort=[], @start_cursor=nil>

### only RollupProperty (none, any, every)
db.properties["RollupTitle"].filter_ends_with "abc", condition: "none", another_type: "rich_text"
# => #<NotionRubyMapping::Query:0x00000001054d9558 @filter={"property"=>"RollupTitle", "none"=>{"rich_text"=>{"ends_with"=>"abc"}}}, @page_size=100, @sort=[], @start_cursor=nil>

↑ Table of Contents