[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Newbie question: Value from YML file into a class...

Darryl L. Pierce

5/27/2008 4:44:00 PM

On my project we're using ActiveLdap. One of our classes, called Account. It
extends the ActiveLdap::Base class and has a call to define it's LDAP
mappings as follows:

class Account < ActiveLdap::Base
ldap_mapping :dn_attribute => 'cn', prefix => 'cn=users,cn=accounts'
end

The value passed to prefix, though, needs to come from a YML file. But, I'm
not sure how to get the value there. I've tried loading the YML elsewhere
and accessing the value, but I'm perpetually getting a nil value. In
another class, named LdapConnection, I load the YML and, from Account, try
to grab the "prefix" value, but no luck.

Any help/advice is appreciated.

--
Darryl L. Pierce <mcpierce@gmail.com>
http://mcpierce.mul...
"Bury me next to my wife. Nothing too fancy, though..." - Ulysses S. Grant
** Posted from http://www.te... **
1 Answer

ara.t.howard

5/30/2008 12:22:00 AM

0


On May 29, 2008, at 6:09 PM, Darryl L. Pierce wrote:

> On my project we're using ActiveLdap. One of our classes, called
> Account. It
> extends the ActiveLdap::Base class and has a call to define it's LDAP
> mappings as follows:
>
> class Account < ActiveLdap::Base
> ldap_mapping :dn_attribute => 'cn', prefix => 'cn=users,cn=accounts'
> end
>
> The value passed to prefix, though, needs to come from a YML file.
> But, I'm
> not sure how to get the value there. I've tried loading the YML
> elsewhere
> and accessing the value, but I'm perpetually getting a nil value. In
> another class, named LdapConnection, I load the YML and, from
> Account, try
> to grab the "prefix" value, but no luck.
>
> Any help/advice is appreciated.

probably the yaml keys are strings and you are accessing them via
symbols.

a @ http://codeforp...
--
we can deny everything, except that we have the possibility of being
better. simply reflect on that.
h.h. the 14th dalai lama