Module: SpudDeprecatedNamespace

Included in:
Spud, Spud::Core
Defined in:
lib/tb_core/spud_core.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_signature, *args, &block) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/tb_core/spud_core.rb', line 10

def method_missing(method_signature, *args, &block)
  if TbCore.respond_to?(method_signature)
    ActiveSupport::Deprecation.warn(
      'The Spud::Core namespace is being replaced by TbCore. Please update your app code accordingly.',
      caller
    )
    TbCore.__send__(method_signature, *args, &block)
  else
    super
  end
end

Instance Method Details

#const_missing(const) ⇒ Object



2
3
4
5
6
7
8
# File 'lib/tb_core/spud_core.rb', line 2

def const_missing(const)
  ActiveSupport::Deprecation.warn(
    'The Spud namespace is being replaced by TbCore. Please update your app code accordingly.',
    caller
  )
  TbCore.const_get(const)
end

#respond_to_missing?(method_signature) ⇒ Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/tb_core/spud_core.rb', line 22

def respond_to_missing?(method_signature)
  TbCore.respond_to?(method_signature) || super
end