Module: HoboSupport

Defined in:
lib/hobo_support.rb,
lib/hobo_support/methodcall.rb

Constant Summary collapse

VERSION =
"1.1.0"
RAILS_VERSION_FLOAT =
Object.const_defined?(:Rails) ? Rails::VERSION::STRING.match(/^\d+\.\d+/)[0].to_f : 0
RAILS_AT_LEAST_23 =
(RAILS_VERSION_FLOAT >= 2.3)

Class Method Summary collapse

Class Method Details

.hobo_try(this, *args, &block) ⇒ Object



13
14
15
16
17
18
19
20
21
# File 'lib/hobo_support/methodcall.rb', line 13

def self.hobo_try(this, *args, &block)
  if args.length==0
    # Hobo style try
    CallIfAvailable.new(this)
  else
    # activesupport 2.3 style try
    this.send(*args, &block)
  end
end