<aside> 👉 Links (Property base class)

ButtonProperty

CheckboxProperty

CreatedByProperty

CreatedTimeProperty

DateProperty

EmailProperty

FilesProperty

FormulaProperty

MultiSelectProperty

LastEditedByProperty

LastEditedTimeProperty

NumberProperty

PeopleProperty

PhoneNumberProperty

Property

RelationProperty

RichTextProperty

RollupProperty

SelectProperty

StatusProperty

TitleProperty

UniqueIdProperty

UrlProperty

VerificationProperty

Notion Ruby Mapping Public API Reference

</aside>

1. Instance methods

[DB/DS] add_select_option(name: a_name, color: a_color) → Array<Hash>

  1. add_select_option adds a select option to Database / DataSource property schema.

  2. add_select_option marks the property as updated and returns the updated option array.

  3. add_select_option of Page property raises StandardError.

    page.properties["SelectTitle"].add_select_option name: "a_name", color: "green"
    # => in `assert_database_or_data_source_property': add_select_option can execute only Database or DataSource property. (StandardError)
    
    ds.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"}]
    

filter_does_not_equal(value) → Query

filter_equals(value) → Query

filter_is_not_empty → Query

filter_is_not_empty → Query

select → Hash

  1. select of Page property returns the raw select object of the page property.

  2. select of Database / DataSource property returns the raw select schema object.

    page.properties["SelectTitle"].select
    # => {"id"=>"b32c83bb-c9af-49e8-9b88-122139affdb7", "name"=>"Select 3", "color"=>"purple"}
    
    ds.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"}]}
    

[P] select=(name)

  1. select=(name) sets the select value of Page property by option name.

  2. select=(nil) creates {"name"=>nil} as the current payload.

  3. select=(name) of Database / DataSource property raises StandardError.

    pp = page.properties["SelectTitle"]
    pp.select = "Select 1"
    pp.select
    # => {"name"=>"Select 1"}
    
    pp.select = nil
    pp.select
    # => {"name"=>nil}
    
    ds.properties["SelectTitle"].select = "Select 3"
    # => ... in `assert_page_property': select= can execute only Page property. (StandardError)