Class: Kamisaku::BaseContentValidator
- Inherits:
-
Object
- Object
- Kamisaku::BaseContentValidator
- Defined in:
- lib/kamisaku/content_validators/base_content_validator.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#content_hash ⇒ Object
(also: #data)
readonly
Returns the value of attribute content_hash.
Instance Method Summary collapse
-
#initialize(content_hash:) ⇒ BaseContentValidator
constructor
A new instance of BaseContentValidator.
- #validate! ⇒ Object
Constructor Details
#initialize(content_hash:) ⇒ BaseContentValidator
Returns a new instance of BaseContentValidator.
6 7 8 9 |
# File 'lib/kamisaku/content_validators/base_content_validator.rb', line 6 def initialize(content_hash:) raise Kamisaku::Error, "content is not a Hash" unless content_hash.is_a? Hash @content_hash = content_hash end |
Instance Attribute Details
#content_hash ⇒ Object (readonly) Also known as: data
Returns the value of attribute content_hash.
3 4 5 |
# File 'lib/kamisaku/content_validators/base_content_validator.rb', line 3 def content_hash @content_hash end |
Instance Method Details
#validate! ⇒ Object
11 12 13 |
# File 'lib/kamisaku/content_validators/base_content_validator.rb', line 11 def validate! # Override by child class end |