Class: AWS::Record::BlockValidator
- Defined in:
- lib/aws/record/validators/block.rb
Constant Summary collapse
- ACCEPTED_OPTIONS =
[:allow_nil, :on, :if, :unless]
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
Attributes inherited from Validator
Instance Method Summary collapse
-
#initialize(*args, &block) ⇒ BlockValidator
constructor
A new instance of BlockValidator.
- #validate_attribute(record, attribute_name, value) ⇒ Object
Methods inherited from Validator
Constructor Details
#initialize(*args, &block) ⇒ BlockValidator
Returns a new instance of BlockValidator.
24 25 26 27 |
# File 'lib/aws/record/validators/block.rb', line 24 def initialize *args, &block @block = block super(*args) end |
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
29 30 31 |
# File 'lib/aws/record/validators/block.rb', line 29 def block @block end |
Instance Method Details
#validate_attribute(record, attribute_name, value) ⇒ Object
31 32 33 |
# File 'lib/aws/record/validators/block.rb', line 31 def validate_attribute record, attribute_name, value block.call(record, attribute_name, value) end |