Class: NotionRubyMapping::CheckboxProperty
- Includes:
- EqualsDoesNotEqual
- Defined in:
- lib/notion_ruby_mapping/checkbox_property.rb
Overview
Checkbox property
Constant Summary collapse
- TYPE =
"checkbox"
Instance Attribute Summary collapse
-
#checkbox ⇒ Object
Returns the value of attribute checkbox.
Attributes inherited from Property
Instance Method Summary collapse
-
#initialize(name, will_update: false, checkbox: false) ⇒ CheckboxProperty
constructor
A new instance of CheckboxProperty.
- #property_values_json ⇒ Hash
- #update_from_json(json) ⇒ Object
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, checkbox: false) ⇒ CheckboxProperty
Returns a new instance of CheckboxProperty.
11 12 13 14 |
# File 'lib/notion_ruby_mapping/checkbox_property.rb', line 11 def initialize(name, will_update: false, checkbox: false) super name, will_update: will_update @checkbox = checkbox end |
Instance Attribute Details
#checkbox ⇒ Object
Returns the value of attribute checkbox.
15 16 17 |
# File 'lib/notion_ruby_mapping/checkbox_property.rb', line 15 def checkbox @checkbox end |
Instance Method Details
#property_values_json ⇒ Hash
31 32 33 |
# File 'lib/notion_ruby_mapping/checkbox_property.rb', line 31 def property_values_json {@name => {"checkbox" => @checkbox, "type" => "checkbox"}} end |
#update_from_json(json) ⇒ Object
25 26 27 28 |
# File 'lib/notion_ruby_mapping/checkbox_property.rb', line 25 def update_from_json(json) @will_update = false @checkbox = json["checkbox"] end |