Class: Devise::Getter

Inherits:
Object
  • Object
show all
Defined in:
lib/devise.rb

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Getter

Returns a new instance of Getter.



323
324
325
# File 'lib/devise.rb', line 323

def initialize(name)
  @name = name
end

Instance Method Details

#getObject



327
328
329
330
331
332
333
334
# File 'lib/devise.rb', line 327

def get
  # TODO: Remove AS::Dependencies usage when dropping support to Rails < 7.
  if ActiveSupport::Dependencies.respond_to?(:constantize)
    ActiveSupport::Dependencies.constantize(@name)
  else
    @name.constantize
  end
end