Error in Hash.value?

I am not able to use the method hash.value ?.
I want to compare with a parameter of the method, but is not working.

Someone help?

#I call the function:
@typeOrder = “title”
if validarOrders(@typeOrder)


#funciotn:
def validarOrders(typeOrder)
typeOrders = {:order1 => “id”, :order2 => “title”, :order3 =>
“edition_year”, :order4 => “authors.name”}

if typeOrders.value?(typeOrder)
    #if typeOrders.value?("title") thus ok
    @out = "ok"
else
    @out = "not"
end

end

Hi Jonas,
The example isn’t a working program, so it’s hard to know what isn’t
working. Also, it’s good to have an error message, line number etc. when
you’re debugging.

So, I’m going to assume that you have a class attribute, @orders, which
is a hash; and a method, #validate(value), which will return true or
false if @orders contains the value given in the method argument:

class MyHash
def initialize(id, title, year)
@orders = {
:order1 => id,
:order2 => title,
:order3 => year
}
end

def validate(value)
@orders.value?(value)
end
end

h = MyHash.new(123, “Trout Fishing”, 1924)
h.validate(“Trout Fishing”) #=> true
h.validate(123) #=> true
h.validate(“Time Travel”) #=> false