Class: Skooma::Validators::Int64
- Inherits:
-
JSONSkooma::Validators::Base
- Object
- JSONSkooma::Validators::Base
- Skooma::Validators::Int64
- Defined in:
- lib/skooma/validators/int_64.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.assert?(instance) ⇒ Boolean
6 7 8 |
# File 'lib/skooma/validators/int_64.rb', line 6 def self.assert?(instance) instance.type == "number" && instance == instance.to_i end |
Instance Method Details
#call(instance) ⇒ Object
10 11 12 13 14 |
# File 'lib/skooma/validators/int_64.rb', line 10 def call(instance) return if instance.value.bit_length <= 64 raise JSONSkooma::Validators::FormatError, "must be a valid int64" end |