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 6048335
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:27:06+00:00 2026-05-23T07:27:06+00:00

When calling set_element on an instance of the Matrix class I get the following

  • 0

When calling set_element on an instance of the Matrix class I get the following error

NoMethodError: private method ‘set_element’ called for Matrix[[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]:Matrix

But set_element is listed under public instance methods in the documentation

Matrix#set_element

Also, set_element is an alias for []=(i, j, v) and using this method I get the following error

ArgumentError: wrong number of arguments (3 for 2)

Doesn’t make any sense, any help is appreciated.

Ruby 1.9.2 p180

  • 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-05-23T07:27:07+00:00Added an answer on May 23, 2026 at 7:27 am

    The documentation is incorrect. If you look at the matrix.rb file from 1.9.1, you’ll see this:

    def []=(i, j, v)
      @rows[i][j] = v
    end
    alias set_element []=
    alias set_component []=
    private :[]=, :set_element, :set_component
    

    So the three methods are there but they are explicitly set as private.

    A bit of quick experimentation indicates that a lot of the methods in the documentation are, in fact, private. There is a big block of documentation at the top of the man page that lists what are, apparently, supposed to be the available methods; that list doesn’t match the list that rdoc has generated so there is some confusion.

    I get the impression that instances of Matrix are meant to be immutable just like Fixnum and Number.

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

Sidebar

Related Questions

When calling DirectoryInfo.GetDirectories(.) on an instance of a DirectoryInfo class which points to a
When calling CoInitializeEx , you can specify the following values for dwCoInit : typedef
By calling Push() and Pop() an instance of Stack<T> in a single line I
I am getting the following error: #1088: The markup in the document following the
I see that when calling the Application.Documents.Open method in word vsto there is a
I have looked at few examples here Calling a Method from an Expression and
Will calling close on my WCF service kill all resources or set them up
Why i cant set selecteditem property programatically? Im calling it from another XAML Window,
Calling Validate() on an XmlDocument requires passing in a ValidationEventHandler delegate. That event function
Calling all C macro gurus... Is there any way to write a C macro

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.