Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/vhdl_parser/magic.rb

Instance Method Summary collapse

Instance Method Details

#is_numeric?boolean

Addition to String class that determines if a String is numeric.

Returns:

  • (boolean)

    Whether the String is numeric.



6
7
8
# File 'lib/vhdl_parser/magic.rb', line 6

def is_numeric?
  true if Float(self) rescue false
end