Class: NotionRubyMapping::CreatedTimeProperty

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

Overview

CreatedTimeProperty

Constant Summary collapse

TYPE =
"created_time"

Instance Attribute Summary collapse

Attributes inherited from Property

#name, #will_update

Instance Method Summary collapse

Methods inherited from DateBaseProperty

#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

Methods included from IsEmptyIsNotEmpty

#filter_is_empty, #filter_is_not_empty

Methods inherited from Property

create_from_json, #make_filter_query, #type

Constructor Details

#initialize(name, created_time: nil) ⇒ CreatedTimeProperty

Returns a new instance of CreatedTimeProperty.

Parameters:

  • name (String)

    Property name

  • created_time (String) (defaults to: nil)

    created_time value (optional)



10
11
12
13
# File 'lib/notion_ruby_mapping/created_time_property.rb', line 10

def initialize(name, created_time: nil)
  super name, will_update: false
  @created_time = created_time
end

Instance Attribute Details

#created_timeObject (readonly)

Returns the value of attribute created_time.



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

def created_time
  @created_time
end

Instance Method Details

#property_values_jsonHash

Returns {} created_time cannot be updated.

Returns:

  • (Hash)

    {} created_time cannot be updated



23
24
25
# File 'lib/notion_ruby_mapping/created_time_property.rb', line 23

def property_values_json
  {}
end

#update_from_json(json) ⇒ Object

Parameters:

  • json (Hash)


17
18
19
20
# File 'lib/notion_ruby_mapping/created_time_property.rb', line 17

def update_from_json(json)
  @will_update = false
  @created_time = json["created_time"]
end