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

  • Home
  • SEARCH
  • 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 9266817
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T14:24:17+00:00 2026-06-18T14:24:17+00:00

I am doing stuff inside the console to try and simulate some code that

  • 0

I am doing stuff inside the console to try and simulate some code that exists in production.
It takes a callback from a call to an API and then does some stuff with the data returned.
Its quite standard stuff but I am trying to simulate the data object that the server returns from my code and I am getting nowhere.

I want to end up some a kind of object that I can assign custom param/value pairs to so that I can access it via dot syntax. E.g.

myObject.thing = value

This is the format that the data from the API returns in.
Is there a way in the console to create an anonymous object, then assign the values myself and use that to run through my code?

  • 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-18T14:24:18+00:00Added an answer on June 18, 2026 at 2:24 pm

    Inside the console type the below:

    >> class myObject 
    ?> attr :testparam 
    ?> end 
    => nil 
    >> i = myObject.new 
    => #myObject...... 
    >> i.testparam = "value" 
    => #myObject..... 
    >> yourcode(i) 
    => results from yourcode...
    

    Here we define a class with a param/property, then instantiate an object.

    We assign a value to the param and pass this object (with param/value) into a function (yourcode) which processes the data from here.

    hope that helps

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

Sidebar

Related Questions

I am doing some server stuff that could potentially fail (not likely) but something
Are they less vulnerable to SQL injection than doing stuff like mysql_query(SELECT important_data FROM
I'm doing some stuff with SQLite, and I want threads to block while I
I have an activity with some views, after doing some stuff I want to
I am doing some staff with mean shift segmentation. I found the code called
I am doing some sample test with git, before i add my actual stuff.
I've a problem with the annotation @Transactional . I've a method doing some stuff,
MyAppDelegate is doing some background stuff and needs to refresh several views during this
I know PAX is doing a lot of stuff and that creating the container
I'm doing an AJAX call (regular JS) and, if it takes more than, say,

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.