lib/ury_rapid/common/payload.rb
# Whether the payload is a valid integer
#
# This includes values that can be coerced into integers, such as
# integral strings.
Whether the payload is a valid integer
This includes values that can be coerced into integers, such as
integral strings.
Whether the payload is a valid integer This includes values that can be coerced into integers such as integral strings .
def valid_integer?
        Integer(@body)
        true
      rescue ArgumentError
        false
      end
def valid_integer? Integer ( @body ) true rescue ArgumentError false end
Whether the payload is a valid integer
This includes values that can be coerced into integers, such as
integral strings.
Whether the payload is a valid integer This includes values that can be coerced into integers such as integral strings .
# A nicer way of doing this would be appreciated. # Could use respond_to?(:to_i), but this is too lenient.