Skip to content

Commit

Permalink
give anonymous class a name for visibility in logs
Browse files Browse the repository at this point in the history
  • Loading branch information
wr0ngway committed Apr 30, 2021
1 parent 7f17c8d commit 58dacfc
Show file tree
Hide file tree
Showing 3 changed files with 548 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/kubetruth/ctapi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module Kubetruth
def self.CtApi(api_key:, api_url: nil)
api_url ||= "https://api.cloudtruth.com/graphql"

Class.new do
clazz = Class.new do

include GemLogger::LoggerSupport

Expand Down Expand Up @@ -168,6 +168,12 @@ def parameters(searchTerm: "", project: nil)
end

end

@ident ||= 0
@ident += 1
Kubetruth.const_set(:"CtApi_#{@ident}", clazz)

return clazz
end

end
Loading

0 comments on commit 58dacfc

Please sign in to comment.