This file contains hidden or 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
| require 'washroom' | |
| washroom = WashroomPool.get | |
| begin | |
| washroom.use | |
| ensure | |
| washroom.flush | |
| end |
This file contains hidden or 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
| require 'dry-struct' | |
| require 'dry-initializer' | |
| module Types | |
| include Dry::Types.module | |
| class ExtHash < ::Hash | |
| def self.from_hash(hsh) | |
| new.merge! hsh | |
| end |
This file contains hidden or 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
| # dispatch method. can be put in base controller | |
| def op(klass) | |
| logger.info "Params: ", params.to_h | |
| obj = klass.new(params.to_h).register(:keystore, @keystore).register(:configstore, @configstore) | |
| resp = obj.process!(self, @context) | |
| rescue => e | |
| logger.error e.message | |
| raise e | |
| end |
OlderNewer