Class: NotionRubyMapping::CommentObject
- Inherits:
-
Object
- Object
- NotionRubyMapping::CommentObject
- Defined in:
- lib/notion_ruby_mapping/objects/comment_object.rb
Overview
CommentObject
Instance Attribute Summary collapse
-
#json ⇒ Object
readonly
Returns the value of attribute json.
-
#text_objects ⇒ Object
readonly
Returns the value of attribute text_objects.
-
#will_update ⇒ Object
readonly
Returns the value of attribute will_update.
Instance Method Summary collapse
- #discussion_id ⇒ Object
-
#full_text ⇒ String
Full_text.
-
#initialize(text_objects: nil, json: {}) ⇒ CommentObject
constructor
A new instance of CommentObject.
Constructor Details
#initialize(text_objects: nil, json: {}) ⇒ CommentObject
Returns a new instance of CommentObject.
7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/notion_ruby_mapping/objects/comment_object.rb', line 7 def initialize(text_objects: nil, json: {}) if text_objects @text_objects = RichTextArray.new "rich_text", text_objects: text_objects @json = {} elsif json @json = json @text_objects = RichTextArray.new "rich_text", json: json["rich_text"] else raise StandardError, "Either text_objects or json is required CommentObject" end @will_update = false end |
Instance Attribute Details
#json ⇒ Object (readonly)
Returns the value of attribute json.
19 20 21 |
# File 'lib/notion_ruby_mapping/objects/comment_object.rb', line 19 def json @json end |
#text_objects ⇒ Object (readonly)
Returns the value of attribute text_objects.
19 20 21 |
# File 'lib/notion_ruby_mapping/objects/comment_object.rb', line 19 def text_objects @text_objects end |
#will_update ⇒ Object (readonly)
Returns the value of attribute will_update.
19 20 21 |
# File 'lib/notion_ruby_mapping/objects/comment_object.rb', line 19 def will_update @will_update end |
Instance Method Details
#discussion_id ⇒ Object
21 22 23 |
# File 'lib/notion_ruby_mapping/objects/comment_object.rb', line 21 def discussion_id NotionCache.instance.hex_id @json["discussion_id"] end |
#full_text ⇒ String
Returns full_text.
26 27 28 |
# File 'lib/notion_ruby_mapping/objects/comment_object.rb', line 26 def full_text @text_objects.full_text end |