Class: TorqueBox::Configuration::FakeConstant Private

Inherits:
Object
  • Object
show all
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

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_constObject

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_sObject

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