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
Instance Method Summary collapse
-
#initialize(name, will_update: false, base_type: :page, json: nil, text_objects: 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, #clear_will_update, create_from_json, #database?, #make_filter_query, #new_name=, #page?, #property_schema_json, #property_values_json, #remove, #type, #update_from_json, #update_property_schema_json
Constructor Details
#initialize(name, will_update: false, base_type: :page, json: nil, text_objects: nil) ⇒ TextProperty
Returns a new instance of TextProperty.
30 31 32 33 34 35 36 37 38 39 |
# 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) raise StandardError, "TextObject is abstract class. Please use RichTextProperty." if instance_of? TextProperty super name, will_update: will_update, base_type: base_type @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
#will_update ⇒ TrueClass, FalseClass
Returns will update?.
42 43 44 |
# File 'lib/notion_ruby_mapping/properties/text_property.rb', line 42 def will_update @will_update || page? && @text_objects.will_update end |