Vijikumar M
Vijikumar M

Reputation: 3764

How to check decimal in ruby?

I downloaded a project from site. It contains a method called find.

   def find(value)

      if value == :decimal
       return true

      else
       return false
      end

  end

I tried with so many values but the condition is not matching. Could you please explain the purpose of value == :decimal??

Upvotes: 0

Views: 584

Answers (1)

xdazz
xdazz

Reputation: 160833

This method returns true if value is the symbol :decimal, otherwise return false.

find(:decimal) # true

Test whether value is symbol :decimal is the only purpose.

Upvotes: 2

Related Questions