<aside> đ Links (Property base class)
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>
date
of Page property returns a Hash object with start
, end
and time_zone
keys.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
# => {}
end_date
of Page property returns the end date or end date-time property value of the page.
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)
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.
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)
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>