Class: NotionRubyMapping::NumberProperty
- 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
-
#number ⇒ Object
Returns the value of attribute number.
Attributes inherited from Property
Instance Method Summary collapse
-
#initialize(name, will_update: false, number: nil) ⇒ NumberProperty
constructor
A new instance of NumberProperty.
- #property_values_json ⇒ Hash
- #update_from_json(json) ⇒ Object
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, will_update: false, number: nil) ⇒ NumberProperty
Returns a new instance of NumberProperty.
13 14 15 16 |
# File 'lib/notion_ruby_mapping/number_property.rb', line 13 def initialize(name, will_update: false, number: nil) super name, will_update: will_update @number = number end |
Instance Attribute Details
#number ⇒ Object
Returns the value of attribute number.
17 18 19 |
# File 'lib/notion_ruby_mapping/number_property.rb', line 17 def number @number end |
Instance Method Details
#property_values_json ⇒ Hash
26 27 28 |
# File 'lib/notion_ruby_mapping/number_property.rb', line 26 def property_values_json {@name => {"number" => @number, "type" => "number"}} end |
#update_from_json(json) ⇒ Object
20 21 22 23 |
# File 'lib/notion_ruby_mapping/number_property.rb', line 20 def update_from_json(json) @will_update = false @number = json["number"] end |