<aside> 👉 Links (Property base class)

Property

ButtonProperty

CreatedTimeProperty

FilesProperty

LastEditedTimeProperty

PeopleProperty

RichTextProperty

StatusProperty

UrlProperty

CheckboxProperty

DateProperty

FormulaProperty

MultiSelectProperty

PhoneNumberProperty

RollupProperty

TitleProperty

VerificationProperty

CreatedByProperty

EmailProperty

LastEditedByProperty

NumberProperty

RelationProperty

SelectProperty

UniqueIdProperty

Notion Ruby Mapping Public API Reference

</aside>

1. Instance methods

filter_does_not_equal(value) → Query

filter_equals(value) → Query

filter_is_not_empty → Query

filter_is_not_empty → Query

status → Hash

  1. [P] status of Page property returns the status property value of the page.

  2. [DB/DS] status of Database / DataSource property returns the raw status schema body, including options and groups when they are included in the retrieved API response.

    page.properties["StatusTitle"].status
    # => {"id"=>"F<XA", "name"=>"Design", "color"=>"purple"}
    
    ds.properties["StatusTitle"].status
    # =>
    # {"options"=>
    #  [{"id"=>"dfd8a326-f149-4b01-b01a-57d8aed6de1b",
    #    "name"=>"Not started",
    #    "color"=>"default"},
    #   {"id"=>"f17767fd-3186-4ba2-8d3a-01eef36e88ec",
    #    "name"=>"In progress",
    #    "color"=>"blue"},
    #   {"id"=>"F<XA", "name"=>"Design", "color"=>"purple"},
    #   {"id"=>"IRXI", "name"=>"Implementation", "color"=>"orange"},
    #   {"id"=>"ceb89388-7f74-4bd5-a52d-0fd572a409f6",
    #    "name"=>"Done",
    #    "color"=>"green"}],
    #  "groups"=>
    #  [{"id"=>"2b356467-0400-420c-ad91-cdd5f98fc799",
    #    "name"=>"To-do",
    #    "color"=>"gray",
    #    "option_ids"=>["dfd8a326-f149-4b01-b01a-57d8aed6de1b"]},
    #   {"id"=>"ff88fa16-34b6-4818-ae5c-f8ce892d888b",
    #    "name"=>"In progress",
    #    "color"=>"blue",
    #    "option_ids"=>["IRXI", "f17767fd-3186-4ba2-8d3a-01eef36e88ec", "F<XA"]},
    #   {"id"=>"de6040ae-17d1-4dc7-939c-b7db49bcf482",
    #    "name"=>"Complete",
    #    "color"=>"green",
    #    "option_ids"=>["ceb89388-7f74-4bd5-a52d-0fd572a409f6"]}]}
    

[P] status=(status)

  1. [P] status=(status) of Page property sets the status property value of the page by option name.

  2. [DB/DS] status=(status) of Database / DataSource property raises StandardError.

  3. To add a status option to Database / DataSource property schema, use add_status_option instead.

    pp = page.properties["StatusTitle"]
    pp.status = "Implementation"
    pp.status
    # => {"name"=>"Implementation"}
    
    ds.properties["StatusTitle"].status = "Implementation"
    # => ... in `assert_page_property': status= can execute only Page property. (StandardError)
    

[P] status_name → String

  1. [P] status_name of Page property returns the status option name of the page.

  2. [DB/DS] status_name of Database / DataSource property raises StandardError.

    page.properties["StatusTitle"].status_name
    # => "Design"
    
    ds.properties["StatusTitle"].status_name
    # => ... in `assert_page_property': status_name can execute only Page property. (StandardError)
    

[DB/DS] status_options → Array<Hash>

  1. [DB/DS] status_options returns the retrieved status schema options.

  2. If the property has no retrieved options, it returns an empty Array.

  3. Unsaved options added by add_status_option are not reflected in status_options. Save and retrieve the DataSource to confirm the updated schema.

    ds.properties["StatusTitle"].status_options
    # =>
    # [{"id"=>"dfd8a326-f149-4b01-b01a-57d8aed6de1b",
    #   "name"=>"Not started",
    #   "color"=>"default"},
    #  {"id"=>"f17767fd-3186-4ba2-8d3a-01eef36e88ec",
    #   "name"=>"In progress",
    #   "color"=>"blue"},
    #  {"id"=>"ceb89388-7f74-4bd5-a52d-0fd572a409f6",
    #   "name"=>"Done",
    #   "color"=>"green"}]
    
    StatusProperty.new("StatusTitle", base_type: "data_source").status_options
    # => []