On Fri, Oct 21, 2011 at 5:26 PM, DM W. <dwhelan / rallydev.com> wrote:
> Robert Klemme wrote in post #1027788:
>> On Fri, Oct 21, 2011 at 4:26 PM, DM W. <dwhelan / rallydev.com> wrote:
>>> I am attempting to create data via a ruby script. One of the require
>>> fields I need to populate is named:
>>> (aard.DLL$)
>>>
>>> I tried using:
>>> :"(aard.dll$)".to_sym =3D> "kimchi" but it did not work. I also tried
>>> ":(aard.dll$)".to.sym =3D> "kimchi"
>>> :"(aard.dll$)" =3D> "kimchi"
>>
>> All these are invalid syntaxes - but not because of special characters
>> in the Symbol but rather because you cannot simply do "expr1 =3D>
>> expr2".
>>
>>> Any ideas? I am a novice, but tried searching online for symbol
>>> identifiers with special characters and could not find anything.
>>
>> First, you do not need to append #to_sym:
>>
>> irb(main):001:0> :"(aard.dll$)" =3D=3D :"(aard.dll$)".to_sym
>> =3D> true
>>
>> Second, maybe you just have the case wrong, because
>>
>> irb(main):002:0> :"(aard.DLL$)" =3D=3D :"(aard.dll$)"
>> =3D> false
>>
>> Please note also that in all these examples no identifier is involved.
>> =A0The item before "=3D>" is at best a key in a Hash, e.g.
>>
>> irb(main):003:0> h =3D {:"(aard.DLL$)" =3D> "kimchi"}
>> =3D> {:"(aard.DLL$)"=3D>"kimchi"}
>>
>> Can you provide a bit more context that explains what you are trying to
>> achieve?
>>
>> Kind regards
>>
>> robert
>
> I am trying to to create data via the Rally API (an agile tool). I am
> creating a story and one of the required fields in the story is a drop
> down list named (aard.DDL$). The options for the drop down list are
> kimchi and bulgolgi, but using kimchi is fine (I know how to rotate
> between the two). so normally I would write something like this:
> user_story =3D @rally.create(:user_story, :name =3D> "this is a test",
> :state =3D> "Open", :"aard.ddl$" =3D> "Kimchi")
> All work expect the last one. :"aard.ddl$" =3D> "Kimchi"

What does "not work" mean?  Please show a specific error.

Cheers

robert


--=20
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/