Class: NotionRubyMapping::CreatedTimeProperty

Inherits:
DateBaseProperty show all
Defined in:
lib/notion_ruby_mapping/properties/created_time_property.rb

Overview

CreatedTimeProperty

Constant Summary collapse

TYPE =
"created_time"

Instance Attribute Summary

Attributes inherited from Property

#name, #property_cache, #property_id, #will_update

Instance Method Summary collapse

Methods inherited from DateBaseProperty

date_from_obj, #filter_after, #filter_before, #filter_does_not_equal, #filter_equals, #filter_next_month, #filter_next_week, #filter_next_year, #filter_on_or_after, #filter_on_or_before, #filter_past_month, #filter_past_week, #filter_past_year, #filter_this_week, start_end_time, value_str, #value_str

Methods included from IsEmptyIsNotEmpty

#filter_is_empty, #filter_is_not_empty

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) ⇒ CreatedTimeProperty

Returns a new instance of CreatedTimeProperty.

Parameters:

  • name (String)

    Property name

  • json (String) (defaults to: nil)

    created_time value (optional)


24
25
26
27
28
29
# File 'lib/notion_ruby_mapping/properties/created_time_property.rb', line 24

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 = json
  @json ||= {} if database?
end

Instance Method Details

#created_timeDate, Hash


14
15
16
# File 'lib/notion_ruby_mapping/properties/created_time_property.rb', line 14

def created_time
  @json
end

#property_values_jsonHash

Page property only methods

Returns:

  • (Hash)

33
34
35
36
# File 'lib/notion_ruby_mapping/properties/created_time_property.rb', line 33

def property_values_json
  assert_page_property __method__
  {}
end