notion_ruby_mapping 0.8.2 → 0.8.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6b33d27349a0f3c21fd44074b802ffad42aa18706798b242417300f52fba74a8
4
- data.tar.gz: 5b09661f6de503b7c706fc98de0dc283bdc5864d237f08e79004c18191cc57f5
3
+ metadata.gz: 0eb2fbf8aece994ee47fac86acbe98ff168cbe78c53b10e782f296fd71bc3adf
4
+ data.tar.gz: fefd260783775cb563e2e647471ba6ee38ed4d0b28ba04095c9eb06a244cd465
5
5
  SHA512:
6
- metadata.gz: 894920b70a06e10c88996310c8e6b0c26c4e027f2f1038bd2edf612a5835af87abaf74d24c6dedf66766ad37a60b63f85a07c114c634ad0af3bdc9c446d067ae
7
- data.tar.gz: db29bd093a59da26a90433e5a97f1a414b8d651c4238344859ef5f63aa6e74787ce0c87e33852cdbeea35d30f46df0d16ba7a493858181889ce0291e81fe43ce
6
+ metadata.gz: ff4a94a978ee7896e94e642cb4ce0af5d2124d2c8a9ffdb847923e06fede8ceb00a59d08d3ee600601fd15e060ece3ddeeb64151b9d7f936bf4ab58a4ddecd2e
7
+ data.tar.gz: 4f26eefe267075799a6a0c022ef13ecd9898660362bbaaf4a96cc1651b6a27336a2e313fc22b0c4277fba3a6ee580f78229475a622ebcf2877ecd05518b085c8
@@ -94,7 +94,7 @@ module NotionRubyMapping
94
94
  json: @nc.retrieve_comments_request(@id, query),
95
95
  query: query).each do |comment|
96
96
  dt_id = comment.discussion_id
97
- dt = ans[dt_id] ||= DiscussionThread.new dt_id
97
+ dt = ans[dt_id] ||= DiscussionThread.new(dt_id)
98
98
  dt.comments << comment
99
99
  end
100
100
  ans
@@ -73,7 +73,7 @@ module NotionRubyMapping
73
73
  # @return [Hash] created json
74
74
  # @param [Object] others
75
75
  def update_property_schema_json(*others)
76
- others.compact.reduce({}) { |hash, o| hash.merge o.update_property_schema_json }.merge @json
76
+ @json.merge(others.compact.reduce({}) { |hash, o| hash.merge o.update_property_schema_json })
77
77
  end
78
78
  end
79
79
  end
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ module NotionRubyMapping
4
+ # Button property
5
+ class ButtonProperty < Property
6
+ TYPE = "button"
7
+
8
+ ### Public announced methods
9
+
10
+ ## Common methods
11
+
12
+ # @return [Boolean, Hash, nil]
13
+ def button
14
+ @json
15
+ end
16
+
17
+ # @param [String] name Property name
18
+ # @param [Boolean, Hash] json
19
+ def initialize(name, will_update: false, base_type: :page, property_id: nil, property_cache: nil, json: nil)
20
+ super name, will_update: will_update, base_type: base_type, property_id: property_id,
21
+ property_cache: property_cache
22
+ @json = json
23
+ end
24
+
25
+ ## Page property only methods
26
+
27
+ # @return [Hash]
28
+ def property_values_json
29
+ assert_page_property __method__
30
+ {@name => {"button" => @json, "type" => "button"}}
31
+ end
32
+ end
33
+ end
@@ -96,6 +96,7 @@ module NotionRubyMapping
96
96
  end
97
97
  else
98
98
  klass = {
99
+ "button" => ButtonProperty,
99
100
  "checkbox" => CheckboxProperty,
100
101
  "created_time" => CreatedTimeProperty,
101
102
  "date" => DateProperty,
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module NotionRubyMapping
4
- VERSION = "0.8.2"
4
+ VERSION = "0.8.4"
5
5
  NOTION_VERSION = "2022-06-28"
6
6
  end
@@ -20,7 +20,7 @@ require_relative "notion_ruby_mapping/version"
20
20
  date_property email_property files_property formula_property last_edited_by_property
21
21
  last_edited_time_property multi_select_property number_property people_property phone_number_property
22
22
  relation_property text_property rich_text_property rollup_property select_property status_property
23
- title_property unique_id_property url_property],
23
+ title_property unique_id_property url_property button_property],
24
24
  }.each do |key, values|
25
25
  values.each do |klass|
26
26
  require_relative "notion_ruby_mapping/#{key}/#{klass}"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: notion_ruby_mapping
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.2
4
+ version: 0.8.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hiroyuki KOBAYASHI
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-07-13 00:00:00.000000000 Z
11
+ date: 2024-04-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -231,6 +231,7 @@ files:
231
231
  - lib/notion_ruby_mapping/objects/rich_text_object.rb
232
232
  - lib/notion_ruby_mapping/objects/text_object.rb
233
233
  - lib/notion_ruby_mapping/objects/user_object.rb
234
+ - lib/notion_ruby_mapping/properties/button_property.rb
234
235
  - lib/notion_ruby_mapping/properties/checkbox_property.rb
235
236
  - lib/notion_ruby_mapping/properties/created_by_property.rb
236
237
  - lib/notion_ruby_mapping/properties/created_time_property.rb
@@ -279,7 +280,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
279
280
  - !ruby/object:Gem::Version
280
281
  version: '0'
281
282
  requirements: []
282
- rubygems_version: 3.4.13
283
+ rubygems_version: 3.5.3
283
284
  signing_key:
284
285
  specification_version: 4
285
286
  summary: Notion Ruby mapping tool