# Lowercase classname

**URL:** <https://www.ruby-forum.com/t/lowercase-classname/199317>\
**Category:** IronRuby\
**Created:** [November 18, 2010, 3:44pm UTC](https://www.ruby-forum.com/t/lowercase-classname/199317 "2010-11-18T15:44:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/77aa72/32.png) [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Post date:** [November 18, 2010, 3:44pm UTC](https://www.ruby-forum.com/t/lowercase-classname/199317/1 "2010-11-18T15:44:56Z")

</div>

Hey guys,

I’m using IronRuby to interface with a clr library. There is a small  
problem however: It has one class that does not start with a capital  
letter. This causes IronRuby to just not see the class since ruby does  
not support lowercase constantnames. Does anyone know if it’s possible  
to work around this in IronRuby (like somehow getting a reference to  
it with a string, and then assigning it to different ruby constant)?  
Or should I make my own clr dll that exposes the class with a  
different (uppercased) name?

Cheers,  
Tinco Andringa (simkor.nl)

---

<div class="post-metadata">

**Author:** ![Tinco\_Andringa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ea666f/32.png) [@Tinco\_Andringa](https://www.ruby-forum.com/u/Tinco_Andringa)\
**Post date:** [November 19, 2010, 12:20am UTC](https://www.ruby-forum.com/t/lowercase-classname/199317/2 "2010-11-19T00:20:00Z")

</div>

Hmm I’ve found the documentation for IronRuby now 😛 It says class  
names should automatically be capitalized. This however seems not to  
have happened since it plainly isn’t available. I have worked around  
the issue by renaming it in the source, but this forces me to ship  
precompiled dll’s instead of referencing the other framework.

Should I file a bugreport? This is on the 1.1.1 release 🙂

Cheers,  
Tinco

---

<div class="post-metadata">

**Author:** ![Tinco\_Andringa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ea666f/32.png) [@Tinco\_Andringa](https://www.ruby-forum.com/u/Tinco_Andringa)\
**Post date:** [November 19, 2010, 1:31am UTC](https://www.ruby-forum.com/t/lowercase-classname/199317/3 "2010-11-19T01:31:01Z")

</div>

This might be a bug in the documentation :-)? Method names are mangled  
so that you can use foo\_bar to call FooBar method.

You should be able to use const\_get(:foo) to get to the constant.

Tomas

---

<div class="post-metadata">

**Author:** ![Tinco\_Andringa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ea666f/32.png) [@Tinco\_Andringa](https://www.ruby-forum.com/u/Tinco_Andringa)\
**Post date:** [November 19, 2010, 2:40pm UTC](https://www.ruby-forum.com/t/lowercase-classname/199317/4 "2010-11-19T14:40:12Z")

</div>

Hey Tomas,

Thanks for the reply. const\_get :foo also raises the constants should  
begin with an uppercase letter error 🙂

Object.const\_get :foo  
(ir):1:in `const_get':`foo’ is not allowed as a constant name  
(NameError)  
from (ir):1

Cheers,  
Tinco

On Fri, Nov 19, 2010 at 00:32, Tomas M.

---

<div class="post-metadata">

**Author:** ![Tinco\_Andringa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ea666f/32.png) [@Tinco\_Andringa](https://www.ruby-forum.com/u/Tinco_Andringa)\
**Post date:** [November 19, 2010, 4:10pm UTC](https://www.ruby-forum.com/t/lowercase-classname/199317/5 "2010-11-19T16:10:36Z")

</div>

On Fri, Nov 19, 2010 at 2:41 PM, Shay F.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)wrote:

> Look here:

[http://www.ironshay.com/post/Working-with-NET-Lowercase-Namespaces-and-Classes-in-IronRuby.aspx](http://www.ironshay.com/post/Working-with-NET-Lowercase-Namespaces-and-Classes-in-IronRuby.aspx)

> 

[http://www.ironshay.com/post/Working-with-NET-Lowercase-Namespaces-and-Classes-in-IronRuby.aspx](http://www.ironshay.com/post/Working-with-NET-Lowercase-Namespaces-and-Classes-in-IronRuby.aspx)

> Shay.

Excellent solution. I mean, really, all the C# classes should start with  
an  
uppercase letter, thats basically a standard, therefore this should be  
the  
only solution and I don’t see no need to actually hack this otherwise  
into  
IronRuby.

---

<div class="post-metadata">

**Author:** ![Tinco\_Andringa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ea666f/32.png) [@Tinco\_Andringa](https://www.ruby-forum.com/u/Tinco_Andringa)\
**Post date:** [November 19, 2010, 2:43pm UTC](https://www.ruby-forum.com/t/lowercase-classname/199317/6 "2010-11-19T14:43:58Z")

</div>

Look here:  
[http://www.ironshay.com/post/Working-with-NET-Lowercase-Namespaces-and-Classes-in-IronRuby.aspx](http://www.ironshay.com/post/Working-with-NET-Lowercase-Namespaces-and-Classes-in-IronRuby.aspx)  
[http://www.ironshay.com/post/Working-with-NET-Lowercase-Namespaces-and-Classes-in-IronRuby.aspx](http://www.ironshay.com/post/Working-with-NET-Lowercase-Namespaces-and-Classes-in-IronRuby.aspx)  
Shay.
