Module: Noah::WatcherValidations

Included in:
Watcher
Defined in:
lib/noah/validations/watcher_validations.rb

Instance Method Summary collapse

Instance Method Details

#assert_not_subset(error = [:pattern, :already_provided]) ⇒ Object



4
5
6
# File 'lib/noah/validations/watcher_validations.rb', line 4

def assert_not_subset(error = [:pattern, :already_provided])
  self.instance_of?(Noah::Watcher) ? (assert endpoint_covered?, error) : (assert false, "Validation not applicable")
end

#assert_not_superset(error = [:pattern, :replaces_existing]) ⇒ Object



8
9
10
# File 'lib/noah/validations/watcher_validations.rb', line 8

def assert_not_superset(error = [:pattern, :replaces_existing])
  self.instance_of?(Noah::Watcher) ? (assert endpoint_overrides?, error) : (assert false, "Validation not applicable")
end

#assert_valid_watch(error = [:pattern, :invalid_format]) ⇒ Object



12
13
14
# File 'lib/noah/validations/watcher_validations.rb', line 12

def assert_valid_watch(error = [:pattern, :invalid_format])
  self.instance_of?(Noah::Watcher) ? (assert pattern_valid?, error) : (assert false, "Validation not applicable")
end