Class: NotionRubyMapping::TitleProperty
- Inherits:
-
TextProperty
- Object
- Property
- TextProperty
- NotionRubyMapping::TitleProperty
- Defined in:
- lib/notion_ruby_mapping/title_property.rb
Overview
TitleProperty
Constant Summary collapse
- TYPE =
"title"
Instance Attribute Summary
Attributes inherited from TextProperty
Attributes inherited from Property
Instance Method Summary collapse
-
#property_values_json ⇒ Hash
Created json.
- #update_from_json(json) ⇒ Object
Methods inherited from TextProperty
#<<, #[], #delete_at, #each, #full_text, #initialize, #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
create_from_json, #initialize, #make_filter_query, #type
Constructor Details
This class inherits a constructor from NotionRubyMapping::TextProperty
Instance Method Details
#property_values_json ⇒ Hash
Returns created json.
15 16 17 18 19 20 21 22 23 |
# File 'lib/notion_ruby_mapping/title_property.rb', line 15 def property_values_json text_json = map(&:property_values_json) { @name => { "type" => "title", "title" => text_json.empty? ? @json : text_json, }, } end |
#update_from_json(json) ⇒ Object
9 10 11 12 |
# File 'lib/notion_ruby_mapping/title_property.rb', line 9 def update_from_json(json) @will_update = false @text_objects = json["title"].map { |to| RichTextObject.create_from_json to } end |