Class: NotionRubyMapping::PhoneNumberProperty
- Defined in:
- lib/notion_ruby_mapping/properties/phone_number_property.rb
Overview
PhoneNumberProperty
Constant Summary collapse
- TYPE =
"phone_number"
Instance Attribute Summary
Attributes inherited from Property
#name, #property_cache, #property_id, #will_update
Instance Method Summary collapse
-
#initialize(name, will_update: false, base_type: "page", json: nil, property_id: nil, property_cache: nil) ⇒ PhoneNumberProperty
constructor
A new instance of PhoneNumberProperty.
-
#phone_number ⇒ String, ...
Phone number (Page), {} (Database).
- #phone_number=(phone_number) ⇒ Object
-
#property_values_json ⇒ Hash
Page property only methods.
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, #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, property_id: nil, property_cache: nil) ⇒ PhoneNumberProperty
Returns a new instance of PhoneNumberProperty.
37 38 39 40 41 |
# File 'lib/notion_ruby_mapping/properties/phone_number_property.rb', line 37 def initialize(name, will_update: false, base_type: "page", json: nil, property_id: nil, property_cache: nil) super name, will_update: will_update, base_type: base_type, property_id: property_id, property_cache: property_cache @json = database? ? {} : json end |
Instance Method Details
#phone_number ⇒ String, ...
Returns phone number (Page), {} (Database).
18 19 20 |
# File 'lib/notion_ruby_mapping/properties/phone_number_property.rb', line 18 def phone_number @json end |
#phone_number=(phone_number) ⇒ Object
26 27 28 29 30 |
# File 'lib/notion_ruby_mapping/properties/phone_number_property.rb', line 26 def phone_number=(phone_number) assert_page_property __method__ @will_update = true @json = phone_number end |
#property_values_json ⇒ Hash
Page property only methods
45 46 47 48 |
# File 'lib/notion_ruby_mapping/properties/phone_number_property.rb', line 45 def property_values_json assert_page_property __method__ {@name => {"phone_number" => @json, "type" => "phone_number"}} end |