Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/pinboard_tools/pinboard_tagger.rb,
lib/pinboard_tools/srl_to_pinboard.rb

Overview

Detect if a string contains only a numeric value

Instance Method Summary collapse

Instance Method Details

#is_number?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/pinboard_tools/pinboard_tagger.rb', line 9

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