Class: ActiveSupport::Dependencies::Reference
- Defined in:
- lib/active_support/dependencies.rb
Constant Summary collapse
- @@constants =
Hash.new { |h, k| h[k] = Inflector.constantize(k) }
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
- #get ⇒ Object
-
#initialize(name) ⇒ Reference
constructor
A new instance of Reference.
Constructor Details
#initialize(name) ⇒ Reference
Returns a new instance of Reference.
532 533 534 535 |
# File 'lib/active_support/dependencies.rb', line 532 def initialize(name) @name = name.to_s @@constants[@name] = name if name.respond_to?(:name) end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
530 531 532 |
# File 'lib/active_support/dependencies.rb', line 530 def name @name end |
Class Method Details
.clear! ⇒ Object
541 542 543 |
# File 'lib/active_support/dependencies.rb', line 541 def self.clear! @@constants.clear end |
Instance Method Details
#get ⇒ Object
537 538 539 |
# File 'lib/active_support/dependencies.rb', line 537 def get @@constants[@name] end |