<aside> 👉 Links (Property base class)

CheckboxProperty

DateProperty

FormulaProperty

MultiSelectProperty

PhoneNumberProperty

RollupProperty

TitleProperty

CreatedByProperty

EmailProperty

LastEditedByProperty

NumberProperty

RelationProperty

SelectProperty

UrlProperty

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

date → Hash

  1. date of Page property returns a Hash object with start, end and time_zone keys.
  2. date of Database property returns an empty Hash {}.
page.properties["DateTitle"].date
# => {"start"=>"2022-03-14", "end"=>nil, "time_zone"=>nil}
db.properties["DateTitle"].date
# => {}

↑ Table of Contents

[P] end_date → String, Date, Time

  1. end_date of Page property returns the end date or end date-time property value of the page.

  2. end_date of Database property raises StandardError.

    page.properties["DateTitle"].end_date
    # => nil
    db.properties["DateTitle"].end_date
    # ...:in `assert_page_property': end_date= can execute only Page property. (StandardError)
    

↑ Table of Contents

[P] end_date=(value) → String, Date, Time

  1. end_date=(value) of Page property sets the end date or end date-time property value of the page and set will_update_flag to true.

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

    page.properties["DateTitle"].end_date = Date.new(2022, 5, 5)
    # => #<Date: 2022-05-05 ((2459705j,0s,0n),+0s,2299161j)>
    db.properties["DateTitle"].end_date = Date.new(2022, 5, 5)
    # ...:in `assert_page_property': end_date= can execute only Page property. (StandardError)
    

↑ Table of Contents

filter_after(value) → Query

filter_after creates a Query object for after filter.

> db.created_time.filter_after Time.new(2022, 5, 4, 21, 30)
# => #<NotionRubyMapping::Query:0x000000011058def8 @filter={"timestamp"=>"created_time", "created_time"=>{"after"=>"2022-05-04T21:30:00+09:00"}}, @page_size=100, @sort=[], @start_cursor=nil>

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

↑ Table of Contents