Class: NotionRubyMapping::UrlProperty

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

Overview

UrlProperty

Constant Summary collapse

TYPE =
"url"

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, url: nil) ⇒ UrlProperty

Returns a new instance of UrlProperty.

Parameters:

  • name (String)

    Property name

  • url (String) (defaults to: nil)

    url value (optional)



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

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

Instance Attribute Details

#urlObject

Returns the value of attribute url.



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

def url
  @url
end

Instance Method Details

#property_values_jsonHash

Returns:

  • (Hash)


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

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

#update_from_json(json) ⇒ Object

Parameters:

  • json (Hash)


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

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