Class: TorqueBox::Configuration::FakeConstant Private
- Inherits:
-
Object
- Object
- TorqueBox::Configuration::FakeConstant
- Defined in:
- lib/torquebox/configuration.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Method Summary collapse
-
#initialize(name) ⇒ FakeConstant
constructor
private
A new instance of FakeConstant.
- #to_const ⇒ Object private
- #to_s ⇒ Object private
Constructor Details
#initialize(name) ⇒ FakeConstant
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of FakeConstant.
180 181 182 183 184 185 186 187 188 189 190 191 192 |
# File 'lib/torquebox/configuration.rb', line 180 def initialize(name) @name = name.to_s s = <<-END module ::#{name} def self.const_missing(k) FakeConstant.new( "#{name}::" + k.to_s ).to_const end end END eval s end |
Instance Method Details
#to_const ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
194 195 196 |
# File 'lib/torquebox/configuration.rb', line 194 def to_const eval @name end |
#to_s ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
198 199 200 |
# File 'lib/torquebox/configuration.rb', line 198 def to_s @name end |