Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/json_path.rb
Constant Summary collapse
- @@is_int_regex =
/\A[-+]?\d+\z/
Instance Method Summary collapse
Instance Method Details
#as_i(default) ⇒ Object
9 10 11 |
# File 'lib/json_path.rb', line 9 def as_i(default) self.is_i? ? self.to_i : default end |
#is_i? ⇒ Boolean
5 6 7 |
# File 'lib/json_path.rb', line 5 def is_i? @@is_int_regex.match?(self) end |