Module: SuckerPunch::Backgroundable::Util

Defined in:
lib/sucker_punch/backgroundable/util.rb

Class Method Summary collapse

Class Method Details

.instance_methods_include?(klass, method) ⇒ Boolean

Returns:

  • (Boolean)


24
25
26
27
# File 'lib/sucker_punch/backgroundable/util.rb', line 24

def instance_methods_include?(klass, method)
  methods_include?(klass.instance_methods, method) ||
    private_instance_methods_include?(klass, method)
end

.methods_include?(methods, method) ⇒ Boolean

Returns:

  • (Boolean)


37
38
39
40
# File 'lib/sucker_punch/backgroundable/util.rb', line 37

def methods_include?(methods, method)
  method = (RUBY_VERSION =~ /^1\.8\./ ? method.to_s : method.to_sym)
  methods.include?(method)
end

.private_instance_methods_include?(klass, method) ⇒ Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/sucker_punch/backgroundable/util.rb', line 29

def private_instance_methods_include?(klass, method)
  methods_include?(klass.private_instance_methods, method)
end

.private_singleton_methods_include?(klass, method) ⇒ Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/sucker_punch/backgroundable/util.rb', line 16

def private_singleton_methods_include?(klass, method)
  methods_include?(klass.private_methods, method)
end

.protected_instance_methods_include?(klass, method) ⇒ Boolean

Returns:

  • (Boolean)


33
34
35
# File 'lib/sucker_punch/backgroundable/util.rb', line 33

def protected_instance_methods_include?(klass, method)
  methods_include?(klass.protected_instance_methods, method)
end

.protected_singleton_methods_include?(klass, method) ⇒ Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/sucker_punch/backgroundable/util.rb', line 20

def protected_singleton_methods_include?(klass, method)
  methods_include?(klass.protected_methods, method)
end

.singleton_methods_include?(klass, method) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
14
# File 'lib/sucker_punch/backgroundable/util.rb', line 11

def singleton_methods_include?(klass, method)
  methods_include?(klass.singleton_methods, method) ||
    private_singleton_methods_include?(klass, method)
end