Class: NotionRubyMapping::TextProperty
- Extended by:
- Forwardable
- Includes:
- Enumerable, ContainsDoesNotContain, EqualsDoesNotEqual, IsEmptyIsNotEmpty, StartsWithEndsWith
- Defined in:
- lib/notion_ruby_mapping/properties/text_property.rb
Overview
Text property
Direct Known Subclasses
Instance Attribute Summary collapse
-
#text_objects ⇒ Object
readonly
Page property only methods.
Attributes inherited from Property
#name, #property_cache, #property_id
Instance Method Summary collapse
- #clear_will_update ⇒ FalseClass
-
#initialize(name, will_update: false, base_type: :page, json: nil, text_objects: nil, property_id: nil, property_cache: nil, query: nil) ⇒ TextProperty
constructor
A new instance of TextProperty.
-
#will_update ⇒ TrueClass, FalseClass
Will update?.
Methods included from IsEmptyIsNotEmpty
#filter_is_empty, #filter_is_not_empty
Methods included from StartsWithEndsWith
#filter_ends_with, #filter_starts_with
Methods included from ContainsDoesNotContain
#filter_contains, #filter_does_not_contain
Methods included from EqualsDoesNotEqual
#filter_does_not_equal, #filter_equals
Methods inherited from Property
#assert_database_property, #assert_page_property, #contents?, create_from_json, #database?, #make_filter_query, #new_name=, #page?, #property_schema_json, #remove, #retrieve_page_property, #type, #update_from_json, #update_property_schema_json
Constructor Details
#initialize(name, will_update: false, base_type: :page, json: nil, text_objects: nil, property_id: nil, property_cache: nil, query: nil) ⇒ TextProperty
Returns a new instance of TextProperty.
30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/notion_ruby_mapping/properties/text_property.rb', line 30 def initialize(name, will_update: false, base_type: :page, json: nil, text_objects: nil, property_id: nil, property_cache: nil, query: nil) raise StandardError, "TextObject is abstract class. Please use RichTextProperty." if instance_of? TextProperty super name, will_update: will_update, base_type: base_type, property_id: property_id, property_cache: property_cache, query: query @text_objects = if database? json || {} else RichTextArray.new "title", json: json, text_objects: text_objects end end |
Instance Attribute Details
#text_objects ⇒ Object (readonly)
Page property only methods
19 20 21 |
# File 'lib/notion_ruby_mapping/properties/text_property.rb', line 19 def text_objects @text_objects end |
Instance Method Details
#clear_will_update ⇒ FalseClass
44 45 46 47 48 |
# File 'lib/notion_ruby_mapping/properties/text_property.rb', line 44 def clear_will_update super @text_objects.clear_will_update if page? false end |
#will_update ⇒ TrueClass, FalseClass
Returns will update?.
51 52 53 |
# File 'lib/notion_ruby_mapping/properties/text_property.rb', line 51 def will_update @will_update || (page? && @text_objects.will_update) end |