# Assign an unknown value to an unknown variable

**URL:** <https://www.ruby-forum.com/t/assign-an-unknown-value-to-an-unknown-variable/102414>\
**Category:** Ruby\
**Created:** [August 15, 2006, 2:16pm UTC](https://www.ruby-forum.com/t/assign-an-unknown-value-to-an-unknown-variable/102414 "2006-08-15T14:16:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vincent\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/5fc32e/32.png) [@Vincent\_A](https://www.ruby-forum.com/u/Vincent_A)\
**Post date:** [August 15, 2006, 2:16pm UTC](https://www.ruby-forum.com/t/assign-an-unknown-value-to-an-unknown-variable/102414/1 "2006-08-15T14:16:55Z")

</div>

Hello,  
I would like to read a configuration file written this way:  
abcd = one  
efgh = two  
ijkl = three

I would like to read this file and be able to call variable abcd.  
I could do it using a hashtable, but I would like to know if there is  
something easier that would do the equivalent of abcd = ‘one’ and let me  
use abcd directly.

Vincent

---

<div class="post-metadata">

**Author:** ![Vincent\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/5fc32e/32.png) [@Vincent\_A](https://www.ruby-forum.com/u/Vincent_A)\
**Post date:** [August 15, 2006, 2:17pm UTC](https://www.ruby-forum.com/t/assign-an-unknown-value-to-an-unknown-variable/102414/2 "2006-08-15T14:17:11Z")

</div>

On 8/11/06, Vincent A. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hello,  
> I would like to read a configuration file written this way:  
> abcd = one  
> efgh = two  
> ijkl = three
> 
> I would like to read this file and be able to call variable abcd.  
> I could do it using a hashtable, but I would like to know if there is  
> something easier that would do the equivalent of abcd = ‘one’ and let me  
> use abcd directly.

What you want is a DSL.

See: [artima - Creating DSLs with Ruby](http://www.artima.com/rubycs/articles/ruby_as_dsl.html)

And work from there
