Class: TorqueBox::Configuration::FakeConstant
- Inherits:
-
Object
- Object
- TorqueBox::Configuration::FakeConstant
- Defined in:
- lib/torquebox/configuration.rb
Instance Method Summary collapse
-
#initialize(name) ⇒ FakeConstant
constructor
A new instance of FakeConstant.
- #to_const ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(name) ⇒ FakeConstant
Returns a new instance of FakeConstant.
174 175 176 177 178 179 180 181 182 183 184 185 186 |
# File 'lib/torquebox/configuration.rb', line 174 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
188 189 190 |
# File 'lib/torquebox/configuration.rb', line 188 def to_const eval @name end |
#to_s ⇒ Object
192 193 194 |
# File 'lib/torquebox/configuration.rb', line 192 def to_s @name end |