<aside> 👉 Links (Object base class)

CommentObject

FileObject

UserObject

EmojiObject

MentionObject

EquationObject

TextObject

Notion Ruby Mapping Public API Reference

</aside>

<aside> ℹī¸ ↑ Table of Contents

</aside>

TextObject is a subclass of RichTextObject.

1. Singleton methods

text_object(value)

to = TextObject.text_object "a text"
=> #<NotionRubyMapping::TextObject:0x0000000105a82590 @options={"plain_text"=>"a text"}, @text="a text", @type="text", @will_update=false>

to2 = TextObject.text_object to
=> #<NotionRubyMapping::TextObject:0x0000000105a82590 @options={"plain_text"=>"a text"}, @text="a text", @type="text", @will_update=false>
# to and to2 are equal objects.

↑ Table of Contents

2. Instance methods

bold=(flag)

code=(flag) color=(color) italic=(flag) strikethrough=(flag) underline=(flag)

bold=, code=, italic=, strikethrough= and underline= set the correspond flag. color= sets the object color.

property.bold = true
property.code = true
property.color = "default"
property.italic = true
property.strikethrough = true
property.underline = true

↑ Table of Contents

text=(str)

text= sets str to text and plain_text, and set will_update flag to true.

to = TextObject.text_object "a text"
=> #<NotionRubyMapping::TextObject:0x0000000105a82590 @options={"plain_text"=>"a text"}, @text="a text", @type="text", @will_update=false>

to.text = "new text"
=> "new text"
=> #<NotionRubyMapping::TextObject:0x0000000105a82590 @options={"plain_text"=>"new text"}, @text="new text", @type="text", @will_update=true>

↑ Table of Contents