Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9137963
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:11:42+00:00 2026-06-17T09:11:42+00:00

So far here’s what I’ve done, and I’m not really sure it’s meant to

  • 0

So far here’s what I’ve done, and I’m not really sure it’s meant to work, but well, better try something than doing nothing. I’ve added a Ruby class in my Winform project and it looks like this:

    class My_Ruby_Class
        def initialize(number)
            @number = number
            change_number()
        end

        def change_number
            @number*= 2
        end

        def get_number
            return @number
        end
    end

So later in my c# MainForm.cs I type:

namespace ruby_in_dotNet_test_01
{

    public partial class MainForm : Form
    {
        public MainForm()
        {
            InitializeComponent();

            int number = 2;

            My_Ruby_Class test = new My_Ruby_Class(number);

            int number2 = test.get_number();

        }
    }
}

Very interestingly the intellisense seems to detect my ruby class and even helps me to fill the areas as I type, so it seems to me I’m on the right path. However it doesn’t compile. The compiler error seems to be related to a missing type or namespace. I tried to surround my ruby class between the ‘module ruby_in_dotNet_test_01’ block but no success.

I’m confused, maybe there’s only one small detail I’m not doing properly, or maybe this approach isn’t meant to work at all?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T09:11:42+00:00Added an answer on June 17, 2026 at 9:11 am

    Basically what you are trying to do won’t work out-of-the box (define ruby code in a file and directly use it from C# and still get strong typing and Intellisense). Did you forget that Ruby is a weakly typed language?

    You could use IronRuby to call ruby code from C#. Here’s a step-by-step article illustrating the process. And here’s a screencast you could watch.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm not sure this is the right place but here I go: I have
I really wonder why this question hasn't popped up here so far. I have
Here's what I've done so far: I've installed Homebrew: /usr/bin/ruby -e $(/usr/bin/curl -fsSL https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb)
I'm following the tutorial here So far so good but the upload example give
My reading is limited as of yet, but so far here are some key
I have searched far and wide here but with no solution to my problem
Here's as far as I understand it: Client & Server make connection Client sends
Here is what i've got so far: /(netscape)|(navigator)\/(\d+)(\.(\d+))?/.test(UserAgentString.toLowerCase()) ? ' netscape'+RegExp.$3+RegExp.$4 : '' I'm
Here is what I have tried thus far: > cd /Applications/MAMP/bin/php5/bin/ > ./pear channel-discover
Here is what I got so far. Please read the comment in the code.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.