Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/utc_rpn_calc/core_ext/string.rb

Constant Summary collapse

NUMERIC_INPUT =
/\A[a-fA-F0-9]+\z/

Instance Method Summary collapse

Instance Method Details

#negation_operation?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/utc_rpn_calc/core_ext/string.rb', line 8

def negation_operation?
  self == "~"
end

#valid_number?Boolean

Returns:

  • (Boolean)


4
5
6
# File 'lib/utc_rpn_calc/core_ext/string.rb', line 4

def valid_number?
  !!match(NUMERIC_INPUT)
end