Sha256: 00c58b36b82ee9a66fbadc2047d176c1ed09a61a3759d23bc88f1e683cef54bc

Contents?: true

Size: 661 Bytes

Versions: 4

Compression:

Stored size: 661 Bytes

Contents

# coding: utf-8

module ThinReports
  module Core
    
    # @private
    module Utils
      def block_exec_on(context, &block)
        return context unless block_given?
        
        if block.arity == 1
          block.call(context)
        else
          context.instance_eval(&block)
        end
        context
      end
      
      if RUBY_VERSION < '1.9'
        def ruby_18
          yield
        end
        def ruby_19
          false
        end
      else
        def ruby_18
          false
        end
        def ruby_19
          yield
        end
      end
    end
    
  end
end

# Include global methods.
include ThinReports::Core::Utils

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
thinreports-0.7.7 lib/thinreports/core/utils.rb
thinreports-0.7.6 lib/thinreports/core/utils.rb
thinreports-0.7.5 lib/thinreports/core/utils.rb
thinreports-0.7.0 lib/thinreports/core/utils.rb