Question

I'm trying to do some XNA development with IronRuby but are struggling with both generics (Load) and accessing some of the base-class properties such as Content.

Any hints?

Was it helpful?

Solution

Regarding Generics - if you want to create a generic object, use square brackets in order to define the generic type. For example:

list = System::Collections::Generic::List[System::String].new

Regarding base class properties, there is no "base" keyword in Ruby so you can use "self" or just call the method or property directly. You might also try to mangle the property name (for instance, HelloWorld is mangled to hello_world). I suggest that in order to access the Content propery, just call it this way:

self.content

Hope it helps, Shay.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top