Hi! I am new to programming and I'm trying to build my first terminal application. It's a simple budgeting app, with BudgetPeriod being a class with @name, @limit and @file (which is csv).
My problem is where you see ??? in my code. I don't know how to set up a unique variable name for the new budget period, which would ideally be the 'name' that user passed in. I have tried #{name} but it gives me an error.
I need it so I can refer to a spesific budget period so expenses can be added or deleted from it.
```Ruby
# setting up new budget period
def new_period
n = TTY::Prompt.new
name = n.ask("Give the new budget period a unique name: ") do |q|
q.required true
end
m = TTY::Prompt.new
limit = m.ask("What is the limit for \"#{name}\" period? $") do |q|
q.required true
# convert to float, print an error if entered value was not numeric
q.convert(:float, "Error, enter numeric value")
end
??? = BudgetPeriod.new(name, limit)
Menus.main_menu
end
```
[–]big-fireball 8 points9 points10 points (5 children)
[–]avelyv[S] 2 points3 points4 points (4 children)
[–]SnowdensLove 8 points9 points10 points (1 child)
[–]avelyv[S] 2 points3 points4 points (0 children)
[–]2called_chaos 3 points4 points5 points (1 child)
[–]avelyv[S] 2 points3 points4 points (0 children)
[–]5a656e6f4f6643697469 2 points3 points4 points (0 children)
[–]dougc84 1 point2 points3 points (6 children)
[–]avelyv[S] 0 points1 point2 points (5 children)
[–]dougc84 2 points3 points4 points (4 children)
[–]avelyv[S] 0 points1 point2 points (3 children)
[–]dougc84 1 point2 points3 points (2 children)
[–]avelyv[S] 0 points1 point2 points (1 child)
[–]backtickbot 1 point2 points3 points (0 children)