Module: Kernel

Defined in:
lib/survey.rb

Instance Method Summary collapse

Instance Method Details

#in_rails_3(&block) ⇒ Object



6
7
8
# File 'lib/survey.rb', line 6

def in_rails_3(&block)
  yield if block_given? unless rails4?
end

#rails4?Boolean

Returns:

  • (Boolean)


2
3
4
# File 'lib/survey.rb', line 2

def rails4?
  return defined?(Rails) && Rails::VERSION::MAJOR == 4
end