Class: DearInventory::Validators::DateTime
- Inherits:
-
DearInventory::Validator
- Object
- DearInventory::Validator
- DearInventory::Validators::DateTime
- Extended by:
- T::Sig
- Defined in:
- lib/dear_inventory/validators/time.rb
Instance Method Summary collapse
Methods inherited from DearInventory::Validator
Constructor Details
This class inherits a constructor from DearInventory::Validator
Instance Method Details
#call ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/dear_inventory/validators/time.rb', line 10 def call value = instance_variable_get(:@value) return if value.nil? return if value.respond_to?(:strftime) raise_error( "expected a DateTime but received the #{value.class} #{value.inspect}" ) end |