<aside> 👉 Links (Property base class)

ButtonProperty

CreatedTimeProperty

FilesProperty

LastEditedTimeProperty

PeopleProperty

RichTextProperty

StatusProperty

UrlProperty

CheckboxProperty

DateProperty

FormulaProperty

MultiSelectProperty

PhoneNumberProperty

RollupProperty

TitleProperty

CreatedByProperty

EmailProperty

LastEditedByProperty

NumberProperty

RelationProperty 🚧

SelectProperty

UniqueIdProperty

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] email → String, Hash, nil

  1. email of Page property returns the email address value.

  2. email of Page property returns nil when the email address is empty.

  3. 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
    # => {}
    

[P] email=(value)

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

  2. email = nil clears the email address value.

  3. email = "" keeps an empty string as-is. It is not converted to nil by NotionRubyMapping.

  4. 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)
    

filter_contains(value) → Query

filter_contains creates a Query object for contains filter.

ds.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)
ds.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>

filter_contains(value) → Query

filter_contains creates a Query object for contains filter.

ds.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)
ds.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>

filter_does_not_equal(value) → Query

filter_ends_with(str) → Query

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

ds.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)
ds.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>

filter_equals(value) → Query

filter_does_not_contain(value) → Query

filter_is_not_empty → Query