<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>

1. Instance methods

[D] add_select_option(name: a_name, color: a_color) → Hash

  1. add_select_option of Page property raises StadndardError

  2. add_select_option of Database property adds a multi-select option value of the database

    page.properties["SelectTitle"].add_select_option name: "a_name", color: "green" 
    # => in `assert_database_property': add_select_option can execute only Database property. (StandardError)
    db.properties["SelectTitle"].add_select_option name: "a_name", color: "green" 
    # => 
    # [{"id"=>"0fed8e50-c917-4b56-96d9-9691a5132fc4", "name"=>"Select 1", "color"=>"brown"},
    #  {"id"=>"0b71c5a8-ea82-4b21-970e-b155e7c68a7e", "name"=>"Select 2", "color"=>"default"},
    #  {"id"=>"b32c83bb-c9af-49e8-9b88-122139affdb7", "name"=>"Select 3", "color"=>"purple"},
    #  {"name"=>"a_name", "color"=>"green"}]
    

↑ 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_equals(value) → Query

filter_equals creates a Query object for equals filter.

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

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

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

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

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

↑ Table of Contents

filter_is_empty → Query

filter_is_empty creates a Query object for is_empty filter.

db.properties["CreatedByTitle"].filter_is_empty
=> #<NotionRubyMapping::Query:0x0000000106af9ef0 @filter={"property"=>"CreatedByTitle", "created_by"=>{"is_empty"=>true}}, @page_size=100, @sort=[], @start_cursor=nil>

↑ Table of Contents

filter_is_not_empty → Query

filter_is_not_empty creates a Query object for is_not_empty filter.

db.properties["CreatedByTitle"].filter_is_not_empty
=> #<NotionRubyMapping::Query:0x00000001104b7290 @filter={"property"=>"CreatedByTitle", "created_by"=>{"is_not_empty"=>true}}, @page_size=100, @sort=[], @start_cursor=nil>

↑ Table of Contents

select → Hash

  1. select of Page property returns the select property value of the page.

  2. select of Database property returns hash with select options values of the database.

    page.properties["SelectTitle"].select
    # => {"id"=>"b32c83bb-c9af-49e8-9b88-122139affdb7", "name"=>"Select 3", "color"=>"purple"}
    db.properties["SelectTitle"].select
    # => 
    # {"options"=>                                           
    #   [{"id"=>"0fed8e50-c917-4b56-96d9-9691a5132fc4", "name"=>"Select 1", "color"=>"brown"},
    #    {"id"=>"0b71c5a8-ea82-4b21-970e-b155e7c68a7e", "name"=>"Select 2", "color"=>"default"},
    #    {"id"=>"b32c83bb-c9af-49e8-9b88-122139affdb7", "name"=>"Select 3", "color"=>"purple"}]}