-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into TAN-814-survey-ui-improvements
- Loading branch information
Showing
249 changed files
with
4,087 additions
and
1,846 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# frozen_string_literal: true | ||
|
||
# rubocop:disable Style/OpenStructUse | ||
|
||
# Latest OpenStruct implementation doesn't define `respond_to_missing?` method | ||
# https://github.com/ruby/ruby/blob/v3_2_0/lib/ostruct.rb | ||
# rubocop:disable Style/MissingRespondToMissing | ||
|
||
# Inspired by https://stackoverflow.com/a/16905766 | ||
class WhinyOpenStruct < OpenStruct | ||
def initialize(hash, raise_exception: true) | ||
@raise_exception = raise_exception | ||
super(hash) | ||
end | ||
|
||
# See https://github.com/ruby/ruby/blob/v2_7_6/lib/ostruct.rb#L99 | ||
def method_missing(meth, *args) | ||
if !meth.to_s.end_with?('=') && !@table.key?(meth) | ||
msg = "No '#{meth}' member set yet" | ||
@raise_exception ? raise(NoMethodError, msg) : ErrorReporter.report_msg(msg) | ||
end | ||
|
||
super | ||
end | ||
end | ||
# rubocop:enable Style/OpenStructUse | ||
# rubocop:enable Style/MissingRespondToMissing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.