Class: NotionRubyMapping::NumberProperty

Inherits:
Property
  • Object
show all
Includes:
EqualsDoesNotEqual, GreaterThanLessThan, IsEmptyIsNotEmpty
Defined in:
lib/notion_ruby_mapping/number_property.rb

Overview

Number property

Constant Summary collapse

TYPE =
"number"

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 GreaterThanLessThan

#filter_greater_than, #filter_greater_than_or_equal_to, #filter_less_than, #filter_less_than_or_equal_to

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, json: nil, number: nil) ⇒ NumberProperty

Returns a new instance of NumberProperty.

Parameters:

  • name (String)

    Property name

  • json (Hash) (defaults to: nil)
  • number (Float) (defaults to: nil)

    Number value (optional)



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

def initialize(name, json: nil, number: nil)
  super(name, json: json)
  @number = number
end

Instance Attribute Details

#numberObject

Returns the value of attribute number.



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

def number
  @number
end

Instance Method Details

#create_jsonHash

Returns:

  • (Hash)


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

def create_json
  {"number" => @number || @json}
end