Top Level Namespace

Defined Under Namespace

Modules: DynamicsNode, TeguGears Classes: Beta, Education, Factorial, Fibonacci, Income, MaximumLikelihoodIntercept, MaximumLikelihoodSlope, Mean, NeighborhoodContext, Object, Operator, PartisanIdentification, RSquared, SSE, SSX, SSXY, SSY, System, Value, Vote

Instance Method Summary collapse

Instance Method Details

#safe_load(val = nil, &block) ⇒ Object

Requires libraries, only if they’re available.



27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/tegu_gears.rb', line 27

def safe_load(val=nil, &block)
  begin
    if block
      block.call
    else
      require val
    end
  # Very important that this is Exception, and not StandardError
  rescue Exception => e 
    false
  end
end