I am new to Rails and Ruby development but I am trying to create an object called Currency which takes in two params and does some calculations on them. I am using
attr_accessor to set up the params and I put the file inside the
Whenever I run
rails console and try to do
c = Currency.new(100, "CAD") I get the following error:
ArgumentError: wrong number of arguments (given 2, expected 0)
from (irb):5:in `initialize'
from (irb):5:in `new'
I did make sure to include the file in
application.rb. Here is a skeleton of my class:
class << self
attr_accessor :input_value, :currency_iso
USD_ISO = "USD"
USD_TO_DM = 2.8054
@input_value / USD_TO_DM
I have looked all over and I am stumped on what this issue may be. I have tried with and without an initialize method and I have tried creating a more basic version.