Class: TorqueBox::Configuration::FakeConstant

Inherits:
Object
  • Object
show all
Defined in:
configure/lib/torquebox/configuration.rb

Instance Method Summary (collapse)

Constructor Details

- (FakeConstant) initialize(name)

Returns a new instance of FakeConstant



180
181
182
183
184
185
186
187
188
189
190
191
192
# File 'configure/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

- (Object) to_const



194
195
196
# File 'configure/lib/torquebox/configuration.rb', line 194

def to_const
  eval @name
end

- (Object) to_s



198
199
200
# File 'configure/lib/torquebox/configuration.rb', line 198

def to_s
  @name
end