Class: NotionRubyMapping::UserObject
- Inherits:
-
Object
- Object
- NotionRubyMapping::UserObject
- Defined in:
- lib/notion_ruby_mapping/objects/user_object.rb
Overview
TextObject
Instance Attribute Summary collapse
-
#user_id ⇒ Object
Returns the value of attribute user_id.
-
#will_update ⇒ Object
readonly
Returns the value of attribute will_update.
Class Method Summary collapse
-
.user_object(user_id_or_uo) ⇒ UserObject
Self or created UserObject.
Instance Method Summary collapse
- #initialize(user_id: nil, json: {}) ⇒ TextObject constructor
- #name ⇒ String
- #property_values_json ⇒ Hash
Constructor Details
#initialize(user_id: nil, json: {}) ⇒ TextObject
8 9 10 11 12 |
# File 'lib/notion_ruby_mapping/objects/user_object.rb', line 8 def initialize(user_id: nil, json: {}) @user_id = user_id || json && json["id"] @json = json @will_update = false end |
Instance Attribute Details
#user_id ⇒ Object
Returns the value of attribute user_id.
13 14 15 |
# File 'lib/notion_ruby_mapping/objects/user_object.rb', line 13 def user_id @user_id end |
#will_update ⇒ Object (readonly)
Returns the value of attribute will_update.
13 14 15 |
# File 'lib/notion_ruby_mapping/objects/user_object.rb', line 13 def will_update @will_update end |
Class Method Details
.user_object(user_id_or_uo) ⇒ UserObject
Returns self or created UserObject.
17 18 19 20 21 22 23 |
# File 'lib/notion_ruby_mapping/objects/user_object.rb', line 17 def self.user_object(user_id_or_uo) if user_id_or_uo.is_a? UserObject user_id_or_uo else UserObject.new user_id: user_id_or_uo end end |
Instance Method Details
#name ⇒ String
26 27 28 |
# File 'lib/notion_ruby_mapping/objects/user_object.rb', line 26 def name @json["name"] end |
#property_values_json ⇒ Hash
31 32 33 34 35 36 |
# File 'lib/notion_ruby_mapping/objects/user_object.rb', line 31 def property_values_json { "object" => "user", "id" => @user_id, } end |