quby-compiler 0.5.20 → 0.5.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 58538613874bd655f416eba086f07ba45321bab1306a6bd710df279e3a9cead0
4
- data.tar.gz: 1a0c1ea24a9c0fd6e8387f6b1760e14d387e1ed41061d66c8176bf642e72f64e
3
+ metadata.gz: 684bb14d23f18ee9aa9be885fbfafcc36a651373daadce74ebec6951c43857b2
4
+ data.tar.gz: 7337db05c0b814ab53682ff6f95c9c31224fcbb6572018c1883b961cd6bff74e
5
5
  SHA512:
6
- metadata.gz: 68251dfd41c4d5054e0d23c7cfa202f6acced87251d2f16b9373c5494d2cbea52955d241479d807e11af8617ced647b49769204b38907bb3728d045a254431cb
7
- data.tar.gz: 6f34cd861fec8ae281c6fffb8dea442054d5500f5e90fb5ff3594cf1d41e3dd28200e601edc29f05e68e7be32653e084f2e5c5c02ea92cbdac87c64c6581e438
6
+ metadata.gz: 7928022fff7e0cb80f1e9cbb417c4d17ace6970aefd82714e67f56d460a44b5bcce00835381fd92bf98532fbc3487c6f33b56f049145e1d0f905ecb06f934d91
7
+ data.tar.gz: 31322a9526b46ba8bb5cfa68eb746c1e74dcc5c29b7efd320667dbbcbe6657fdd1961a64d7fe1aa7f999e36c28ae5295a440c635d9786ec340b3c53773e92a45
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 0.5.21
2
+
3
+ * Allow custom methods inside info_blocks
4
+
1
5
  # 0.5.20
2
6
 
3
7
  * dsl: Add info_block support
@@ -11,9 +11,10 @@ module Quby
11
11
  delegate :panel, to: :info_block
12
12
  delegate :questionnaire, to: :panel
13
13
 
14
- def initialize(key, start_open: true, panel:, default_question_options:)
14
+ def initialize(key, start_open: true, panel:, default_question_options:, custom_methods:)
15
15
  @info_block = Entities::InfoBlock.new(key: , panel:, start_open:)
16
16
  @default_question_options = default_question_options
17
+ @custom_methods = custom_methods
17
18
  check_key_uniqueness(key, questionnaire:)
18
19
  questionnaire.fields.info_block_keys << key
19
20
  panel.items << @info_block
@@ -38,6 +39,14 @@ module Quby
38
39
  questionnaire.register_question(question)
39
40
  info_block.items << question
40
41
  end
42
+
43
+ def method_missing(method_sym, *args, **kwargs, &block)
44
+ if @custom_methods.key? method_sym
45
+ instance_exec(*args, **kwargs, &@custom_methods[method_sym])
46
+ else
47
+ super
48
+ end
49
+ end
41
50
  end
42
51
  end
43
52
  end
@@ -70,6 +70,7 @@ module Quby
70
70
  key,
71
71
  panel: @panel,
72
72
  default_question_options: @default_question_options,
73
+ custom_methods: @custom_methods,
73
74
  **options
74
75
  info_block_builder.instance_eval(&block)
75
76
  end
@@ -1,5 +1,5 @@
1
1
  module Quby
2
2
  module Compiler
3
- VERSION = "0.5.20"
3
+ VERSION = "0.5.21"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quby-compiler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.20
4
+ version: 0.5.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marten Veldthuis
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-05-22 00:00:00.000000000 Z
10
+ date: 2025-05-23 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: activemodel