Class: HaveAPI::Validators::Custom

Inherits:
HaveAPI::Validator show all
Defined in:
lib/haveapi/validators/custom.rb

Overview

Custom validator. It has only a short form, taking the description of the validator. This validator passes every value. It is up to the developer to implement the validation in HaveAPI::Action.exec.

Instance Attribute Summary

Attributes inherited from HaveAPI::Validator

#message, #params

Instance Method Summary collapse

Methods inherited from HaveAPI::Validator

#initialize, name, #reconfigure, takes, use, use?, #useful?, #validate

Constructor Details

This class inherits a constructor from HaveAPI::Validator

Instance Method Details

#describeObject



15
16
17
# File 'lib/haveapi/validators/custom.rb', line 15

def describe
  @desc
end

#setupObject



11
12
13
# File 'lib/haveapi/validators/custom.rb', line 11

def setup
  @desc = take
end

#valid?(v) ⇒ Boolean

Returns:



19
20
21
# File 'lib/haveapi/validators/custom.rb', line 19

def valid?(v)
  true
end