Skip to content

Commit

Permalink
Hotfix
Browse files Browse the repository at this point in the history
Ivan Chinenov committed Sep 30, 2021
1 parent 3a97807 commit be312cd
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/lens/typed_lens.rb
Original file line number Diff line number Diff line change
@@ -15,11 +15,12 @@ def initialize(**kwargs)

def call(object)
@getable = object.respond_to? :[]
@kwargs.each_with_object({}) do |(sym, _ty), acc|
result = @kwargs.each_with_object({}) do |(sym, _ty), acc|
val = extract(sym, object)
acc[sym] = typecheck(sym, val)
end
@getable = nil
result
end

def validate_arguments
3 changes: 2 additions & 1 deletion lib/lens/untyped.rb
Original file line number Diff line number Diff line change
@@ -15,10 +15,11 @@ def initialize(*args)

def call(object)
@getable = object.respond_to? :[]
@args.each_with_object({}) do |sym, acc|
result = @args.each_with_object({}) do |sym, acc|
acc[sym] = extract(sym, object)
end
@getable = nil
result
end

def extract(sym, object)

0 comments on commit be312cd

Please sign in to comment.