Class: NotionRubyMapping::LastEditedByProperty
- Inherits:
-
MultiProperty
- Object
- Property
- MultiProperty
- NotionRubyMapping::LastEditedByProperty
- Defined in:
- lib/notion_ruby_mapping/last_edited_by_property.rb
Overview
LastEditedByProperty
Constant Summary collapse
- TYPE =
"last_edited_by"
Instance Attribute Summary collapse
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Attributes inherited from Property
Instance Method Summary collapse
-
#initialize(name, will_update: false, base_type: :page, json: nil, user_id: nil) ⇒ LastEditedByProperty
constructor
A new instance of LastEditedByProperty.
- #last_edited_by ⇒ NotionRubyMapping::UserObject, Hash
- #update_from_json(json) ⇒ Object
Methods included from IsEmptyIsNotEmpty
#filter_is_empty, #filter_is_not_empty
Methods included from ContainsDoesNotContain
#filter_contains, #filter_does_not_contain
Methods inherited from Property
#assert_database_property, #assert_page_property, #clear_will_update, create_from_json, #database?, #make_filter_query, #new_name=, #page?, #property_schema_json, #property_values_json, #remove, #type, #update_property_schema_json
Constructor Details
#initialize(name, will_update: false, base_type: :page, json: nil, user_id: nil) ⇒ LastEditedByProperty
Returns a new instance of LastEditedByProperty.
24 25 26 27 28 29 30 31 |
# File 'lib/notion_ruby_mapping/last_edited_by_property.rb', line 24 def initialize(name, will_update: false, base_type: :page, json: nil, user_id: nil) super name, will_update: will_update, base_type: base_type @json = if database? json || {} else UserObject.new user_id: user_id, json: json end end |
Instance Attribute Details
#user ⇒ Object (readonly)
Returns the value of attribute user.
32 33 34 |
# File 'lib/notion_ruby_mapping/last_edited_by_property.rb', line 32 def user @user end |
Instance Method Details
#last_edited_by ⇒ NotionRubyMapping::UserObject, Hash
13 14 15 |
# File 'lib/notion_ruby_mapping/last_edited_by_property.rb', line 13 def last_edited_by @json end |
#update_from_json(json) ⇒ Object
35 36 37 38 39 |
# File 'lib/notion_ruby_mapping/last_edited_by_property.rb', line 35 def update_from_json(json) @will_update = false leb = json["last_edited_by"] @json = database? ? leb : UserObject.new(json: leb) end |