🧮

TitleProperty

1. Instance methods

[P] self[num] → RichTextObject

  • [PARAM] num index number
self[num] delegates to included @text_object[num].
  1. self[num] of Page property returns a RichTextObject corresponded to num
  1. self[num] of Database property returns nil, because @text_object of the property is {}.
    1. page.properties["Title"][0] # => #<NotionRubyMapping::TextObject:...> db.properties["Title"][0] # => nil

[P] self << to → RichTextObject

  • [PARAM] to
    • a_string (String)
    • a_text_object (RichTextObject)
self << to delegates to included @text_object << to. If the argument is a String, it is converted to RichTextObject and append to @text_object. This method returns generated or given RichTextObject.
ptp = page.properties["Title"] ptp << "Added text" # => #<NotionRubyMapping::TextObject:0x0000000108f79960 @options={"plain_text"=>"Added text"}, @text="Added text", @type="text", @will_update=false> ptp.full_text # => "MNOAdded text" ptp << MentionObject.new("template_mention" => "now") # => #<NotionRubyMapping::MentionObject:0x0000000109739f60 @options={"template_mention"=>"now"}, @type="mention">

[P] self.each { |item| ...} → self [P] self.each → Enumerator

self.each delegates to included @text_object.each. Since RichTextProperty includes Enumerable, other Enumerable methods can be used.
ptp = page.properties["Title"] ptp.count # => 1 ptp.map(&:text) # => ["MNO"]

filter_contains(value) →
🎛️
Query

  • [PARAM] value value_for_filter
filter_contains creates a Query object for contains filter.
db.properties["CreatedByTitle"].filter_contains "a_user_id" # => #<NotionRubyMapping::Query:0x0000000110525498 @filter={"property"=>"CreatedByTitle", "created_by"=>{"contains"=>"a_user_id"}}, @page_size=100, @sort=[], @start_cursor=nil> ### only RollupProperty (none, any, every) db.properties["RollupTitle"].filter_contains "abc", condition: "any", another_type: "rich_text" # => #<NotionRubyMapping::Query:0x0000000105394f30 @filter={"property"=>"RollupTitle", "any"=>{"rich_text"=>{"contains"=>"abc"}}}, @page_size=100, @sort=[], @start_cursor=nil>

filter_does_not_contain(value) →
🎛️
Query

  • [PARAM] value value_for_filter
filter_does_not_contain creates a Query object for does_not_contain filter.
db.properties["CreatedByTitle"].filter_does_not_contain "a_user_id" => #<NotionRubyMapping::Query:0x0000000110666b68 @filter={"property"=>"CreatedByTitle", "created_by"=>{"does_not_contain"=>"a_user_id"}}, @page_size=100, @sort=[], @start_cursor=nil> ### only RollupProperty (none, any, every) db.properties["CreatedByTitle"].filter_does_not_contain "abc", condition: "every", another_type: "people" # => #<NotionRubyMapping::Query:0x000000010533e888 @filter={"property"=>"RollupTitle", "every"=>{"people"=>{"does_not_contain"=>"abc"}}}, @page_size=100, @sort=[], @start_cursor=nil>

filter_does_not_equal(value) →
🎛️
Query

  • [PARAM] value value for filter
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>

filter_ends_with(str) →
🎛️
Query

filter_ends_with(str) creates a Query object for ends_with filter.
db.properties["MailTitle"].filter_ends_with "ac.jp" => #<NotionRubyMapping::Query:0x0000000105281b48 @filter={"property"=>"MailTitle", "email"=>{"ends_with"=>"ac.jp"}}, @page_size=100, @sort=[], @start_cursor=nil> ### only RollupProperty (none, any, every) db.properties["RollupTitle"].filter_ends_with "abc", condition: "none", another_type: "rich_text" # => #<NotionRubyMapping::Query:0x00000001054d9558 @filter={"property"=>"RollupTitle", "none"=>{"rich_text"=>{"ends_with"=>"abc"}}}, @page_size=100, @sort=[], @start_cursor=nil>

filter_equals(value) →
🎛️
Query

  • [PARAM] value value for filter
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>

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>

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>

filter_starts_with(str) →
🎛️
Query

filter_starts_with(str) creates a Query object for starts_with filter.
db.properties["MailTitle"].filter_starts_with "hkob" => #<NotionRubyMapping::Query:0x0000000101377218 @filter={"property"=>"MailTitle", "email"=>{"starts_with"=>"hkob"}}, @page_size=100, @sort=[], @start_cursor=nil> ### only RollupProperty (none, any, every) db.properties["RollupTitle"].filter_starts_with "abc", condition: "none", another_type: "rich_text" => #<NotionRubyMapping::Query:0x0000000105523c70 @filter={"property"=>"RollupTitle", "none"=>{"rich_text"=>{"starts_with"=>"abc"}}}, @page_size=100, @sort=[], @start_cursor=nil>

[P] full_text → String

self.full_text delegates to included @text_object.full_text.
page.properties["Title"].full_text # => "MNO"