Skip to content

Instantly share code, notes, and snippets.

@enebo

enebo/fn.rb Secret

Created June 23, 2021 18:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save enebo/0d4a94669888555cc6621937220596cb to your computer and use it in GitHub Desktop.
Save enebo/0d4a94669888555cc6621937220596cb to your computer and use it in GitHub Desktop.
class Fn
implements java.util.function.Supplier
def initialize(&code)
@code = code
end
def get
@code.call
end
def self.fn(&block)
new &block
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment