Class: NotionRubyMapping::EmailProperty

Inherits:
Property
  • Object
show all
Includes:
ContainsDoesNotContain, EqualsDoesNotEqual, IsEmptyIsNotEmpty, StartsWithEndsWith
Defined in:
lib/notion_ruby_mapping/email_property.rb

Overview

EmailProperty

Constant Summary collapse

TYPE =
"email"

Instance Attribute Summary collapse

Attributes inherited from Property

#name, #will_update

Instance Method Summary collapse

Methods included from IsEmptyIsNotEmpty

#filter_is_empty, #filter_is_not_empty

Methods included from StartsWithEndsWith

#filter_ends_with, #filter_starts_with

Methods included from ContainsDoesNotContain

#filter_contains, #filter_does_not_contain

Methods included from EqualsDoesNotEqual

#filter_does_not_equal, #filter_equals

Methods inherited from Property

create_from_json, #make_filter_query, #type

Constructor Details

#initialize(name, will_update: false, email: nil) ⇒ EmailProperty

Returns a new instance of EmailProperty.

Parameters:

  • name (String)

    Property name

  • email (String) (defaults to: nil)

    email value (optional)



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

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

Instance Attribute Details

#emailObject

Returns the value of attribute email.



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

def email
  @email
end

Instance Method Details

#property_values_jsonHash

Returns:

  • (Hash)


27
28
29
# File 'lib/notion_ruby_mapping/email_property.rb', line 27

def property_values_json
  {@name => {"email" => @email, "type" => "email"}}
end

#update_from_json(json) ⇒ Object

Parameters:

  • json (Hash)


21
22
23
24
# File 'lib/notion_ruby_mapping/email_property.rb', line 21

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