Sha256: 1c6838934d40a17db71bb8c0116ca69963f03b287e55132b33fcdda5e8bccdec

Contents?: true

Size: 362 Bytes

Versions: 3

Compression:

Stored size: 362 Bytes

Contents

module Grape
  module Util
    class LazyBlock
      def initialize(&new_block)
        @block = new_block
      end

      def evaluate_from(configuration)
        @block.call(configuration)
      end

      def evaluate
        @block.call({})
      end

      def lazy?
        true
      end

      def to_s
        evaluate.to_s
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
grape-extra_validators-2.0.0 vendor/bundle/ruby/2.6.0/gems/grape-1.2.5/lib/grape/util/lazy_block.rb
grape-extra_validators-1.0.0 vendor/bundle/ruby/2.4.0/gems/grape-1.2.5/lib/grape/util/lazy_block.rb
grape-1.2.5 lib/grape/util/lazy_block.rb