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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:20:28+00:00 2026-05-26T02:20:28+00:00

1) I have a method def self.createobj(api_key, amnt, commentstr, orderid, order_creation_date, orderfullfilmentdate) ….. end

  • 0

1) I have a method

def self.createobj(api_key, amnt, commentstr, orderid, order_creation_date, orderfullfilmentdate)  
.....
end

2) I want to create a error_str of all the parameters passed to this function …

2.1) Something like

errorstr = "api_key: " + api_key.to_s + " amnt: " + amnt.to_s + " commentstr: " + commentstr.to_s + " orderid: " + orderid.to_s + " order_creation_date: " + order_creation_date.to_s + " orderfullfilmentdate: " + orderfullfilmentdate.to_s

2.2) So I created another method

def self.get_params_str(a)
    str = ""
    a.each do |a|
      str = str + a.to_s
    end
    return str
end  

2.3) So I call this new method from createobj. Something like

def self.createobj(api_key, amnt, commentstr, orderid, order_creation_date, orderfullfilmentdate)  
errorstr = get_params_str(args)
.....
end

3) But I get error undefined local variable or method `args’ for #. Shouldn’t args have all parameters?

Please advice.

  • 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-26T02:20:28+00:00Added an answer on May 26, 2026 at 2:20 am

    args would only contain the parameters if your method definition was something like def self.createobj(*args). Without that args isn’t defined.

    You will need to manually pass all of the parameters to get_params_str. You will need to pass them as an array, i.e get_params_str([api_key, amnt, commentstr, ...]) unless you change get_params_str‘s method signature to def self.get_params_str(*a) (which puts all of the parameters passed to get_params_str into a single array`).

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

Sidebar

Related Questions

I have a private method def __pickSide(self): in a parent class that I would
I'm new to Python. I have a method that begins: def foo(self, list): length
If you have a controller method like so: @expose(json) def artists(self, action=view,artist_id=None): artists=session.query(model.Artist).all() return
I have a method which calls for a classmethod of another class def get_interface_params_by_mac(self,
I have a method defined in ApplicationController : def some_checking ... end And I
I have a method in a Pygame Sprite subclass, defined as such: def walk(self):
Have a method with the following signature: def foo(self, bar, *uks): return other_method(..., uks)
I have some code, which binds a menu item to a method: def getEventID(self,
i have a method in a model that looks like this: def self.super_data self.find(:all,
I have a method that calls two other methods in it. def main_method(self, query):

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.