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