on-internet
← Community

How do I know which types are expected? Where do I get that information from?

Stack Overflow ·

Let's say I've got this class: class Person attr_accessor :first_name, :last_name, :email, :projects def initialize(first_name:, last_name:, email:, projects:) @first_name = first_name @last_name = last_name @email = email @projects = projects end end How would someone who wants to create a Person object know which arguments have to be passed? The first three arguments one could guess that it’s a string. But with the fourth argument it is completely unobvious. Could be comma-separated string, IDs, could be an array, dictionary, etc. And what structure does the array have? Does it contain strin

Comments

Sign in or sign up to comment and upvote.

No comments yet.