Class: NotionRubyMapping::SelectProperty
- Includes:
- EqualsDoesNotEqual, IsEmptyIsNotEmpty
- Defined in:
- lib/notion_ruby_mapping/select_property.rb
Overview
Select property
Constant Summary collapse
- TYPE =
"select"
Instance Attribute Summary
Attributes inherited from Property
Instance Method Summary collapse
- #create_json ⇒ Hash
-
#initialize(name, json: nil, select: nil) ⇒ SelectProperty
constructor
A new instance of SelectProperty.
-
#select=(select) ⇒ String
Settled value.
Methods included from IsEmptyIsNotEmpty
#filter_is_empty, #filter_is_not_empty
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, select: nil) ⇒ SelectProperty
Returns a new instance of SelectProperty.
13 14 15 16 |
# File 'lib/notion_ruby_mapping/select_property.rb', line 13 def initialize(name, json: nil, select: nil) super(name, json: json) @select = select end |
Instance Method Details
#create_json ⇒ Hash
19 20 21 |
# File 'lib/notion_ruby_mapping/select_property.rb', line 19 def create_json {"select" => @select ? {"name" => @select} : @json} || {} end |
#select=(select) ⇒ String
Returns settled value.
25 26 27 28 |
# File 'lib/notion_ruby_mapping/select_property.rb', line 25 def select=(select) @will_update = true @select = select end |