Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Well what are the properties of config_options or app_user or objects like these? Is it even documented, or am I forced to scan the entire method trying to figure out?


Typically I would initialize an AppUser object and print out its default representation. You can quickly find info on an object by doing something like:

    AppUser.new 
      => prints all properties of the object with nil values 

    AppUser.instance_methods - ActiveRecord::Base.instance_methods 
    => prints all unique instance methods on that class
values

config_options is extremely generic but I would expect that it is a Hash of key/value pairs. Given the fact that it has options in the name you are likely going to have to look it up regardless as you have multiple choices when using it. I'd expect some documentation if it is truly configurable, or you can transparently look at the method signature if it uses keyword args. (say for a library that handles formatting currency)

Quickly reading other people's code is a definite skill. While it can be a pain to do, it is worthwhile since the code is the only real source of truth.


Yeah, of course there are ways of doing it. But if you define types you can in a second be looking at all the possible values. The tools help you be more productive and make fewer mistakes.




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: