class Dates
ATTRS = {date_from: '', date_to: ''}
def set_dates(ATTRS)
@date_from = date_from
@date_to = date_to
end
def show_dates(ATTRS)
p date_from
p date_to
end
end
Dates.new.set_dates(date_from: Time.current, date_to: Time.current)
#-:4: formal argument cannot be a constant
# def set_dates(ATTRS)
# ^
#-:9: formal argument cannot be a constant
# def show_dates(ATTRS)
SO question is: Is it possible to store method attributes in variable ?
def set_dates(ATTRS)todef set_dates(**args). This is keyword arguments.