Skip to content

Commit 427aaa6

Browse files
committed
Fix inject_context
1 parent 0bbd93c commit 427aaa6

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
shale-builder (0.6.0)
4+
shale-builder (0.6.1)
55
booleans (>= 0.1)
66
shale (< 2.0)
77
sorbet-runtime (> 0.5)

lib/shale/builder.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,8 @@ def attribute_values
226226
#: (**untyped) -> void
227227
def inject_context(**context)
228228
context.each do |name, val|
229-
try(:"#{name}=", val)
229+
setter = :"#{name}="
230+
public_send(setter, val) if respond_to?(setter)
230231
end
231232

232233
klass = self.class #: as untyped

lib/shale/builder/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
module Shale
44
module Builder
5-
VERSION = '0.6.0'
5+
VERSION = '0.6.1'
66
end
77
end

0 commit comments

Comments
 (0)