Class: Membrane::Schemas::Dictionary
- Defined in:
- lib/membrane/schemas/dictionary.rb
Defined Under Namespace
Classes: HashValidator, MembersValidator
Instance Attribute Summary collapse
-
#key_schema ⇒ Object
readonly
Returns the value of attribute key_schema.
-
#value_schema ⇒ Object
readonly
Returns the value of attribute value_schema.
Instance Method Summary collapse
-
#initialize(key_schema, value_schema) ⇒ Dictionary
constructor
A new instance of Dictionary.
- #validate(object) ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(key_schema, value_schema) ⇒ Dictionary
Returns a new instance of Dictionary.
13 14 15 16 |
# File 'lib/membrane/schemas/dictionary.rb', line 13 def initialize(key_schema, value_schema) @key_schema = key_schema @value_schema = value_schema end |
Instance Attribute Details
#key_schema ⇒ Object (readonly)
Returns the value of attribute key_schema.
10 11 12 |
# File 'lib/membrane/schemas/dictionary.rb', line 10 def key_schema @key_schema end |
#value_schema ⇒ Object (readonly)
Returns the value of attribute value_schema.
11 12 13 |
# File 'lib/membrane/schemas/dictionary.rb', line 11 def value_schema @value_schema end |
Instance Method Details
#validate(object) ⇒ Object
18 19 20 21 |
# File 'lib/membrane/schemas/dictionary.rb', line 18 def validate(object) HashValidator.new(object).validate MembersValidator.new(@key_schema, @value_schema, object).validate end |