Class: NotionRubyMapping::VerificationProperty

Inherits:
Property
  • Object
show all
Defined in:
lib/notion_ruby_mapping/properties/verification_property.rb

Overview

Verification property

Constant Summary collapse

TYPE =
"verification"

Instance Attribute Summary

Attributes inherited from Property

#name, #property_cache, #property_id, #will_update

Instance Method Summary collapse

Methods inherited from Property

#assert_data_source_property, #assert_database_or_data_source_property, #assert_page_property, #clear_will_update, create_from_json, #data_source?, #database?, #database_or_data_source?, #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", property_id: nil, property_cache: nil, json: {}) ⇒ VerificationProperty

Returns a new instance of VerificationProperty.

Parameters:

  • name (String, Symbol)

    Property name

  • json (Hash) (defaults to: {})


22
23
24
25
26
# File 'lib/notion_ruby_mapping/properties/verification_property.rb', line 22

def initialize(name, will_update: false, base_type: "page", property_id: nil, property_cache: nil, json: {})
  super name, will_update: will_update, base_type: base_type, property_id: property_id,
              property_cache: property_cache
  @json = json
end

Instance Method Details

#filter_status(value, condition: nil, another_type: nil) ⇒ NotionRubyMapping::Query

Creates a filter query for the verification status.

Parameters:

  • value (String)

    Verification status. Expected values are "verified", "expired", and "none".

  • condition (String, nil) (defaults to: nil)

    Rollup condition name.

  • another_type (String, nil) (defaults to: nil)

    Rollup target type.

Returns:



36
37
38
# File 'lib/notion_ruby_mapping/properties/verification_property.rb', line 36

def filter_status(value, condition: nil, another_type: nil)
  make_filter_query "status", value, condition: condition, another_type: another_type
end

#property_values_jsonHash

Returns:

  • (Hash)


43
44
45
46
# File 'lib/notion_ruby_mapping/properties/verification_property.rb', line 43

def property_values_json
  assert_page_property __method__
  {@name => {"verification" => @json, "type" => TYPE}}
end

#verificationObject

Common methods



12
13
14
# File 'lib/notion_ruby_mapping/properties/verification_property.rb', line 12

def verification
  @json
end