Class: Definition::Types::Keys
- Includes:
- Dsl
- Defined in:
- lib/definition/types/keys.rb
Defined Under Namespace
Modules: Dsl Classes: Conformer
Instance Attribute Summary collapse
-
#optional_definitions ⇒ Object
Returns the value of attribute optional_definitions.
-
#required_definitions ⇒ Object
Returns the value of attribute required_definitions.
Attributes inherited from Base
Instance Method Summary collapse
- #conform(value) ⇒ Object
-
#initialize(name, req: {}, opt: {}) ⇒ Keys
constructor
A new instance of Keys.
- #keys ⇒ Object
Methods included from Dsl
Methods inherited from Base
Constructor Details
#initialize(name, req: {}, opt: {}) ⇒ Keys
Returns a new instance of Keys.
24 25 26 27 28 |
# File 'lib/definition/types/keys.rb', line 24 def initialize(name, req: {}, opt: {}) super(name) self.required_definitions = req self.optional_definitions = opt end |
Instance Attribute Details
#optional_definitions ⇒ Object
Returns the value of attribute optional_definitions.
22 23 24 |
# File 'lib/definition/types/keys.rb', line 22 def optional_definitions @optional_definitions end |
#required_definitions ⇒ Object
Returns the value of attribute required_definitions.
22 23 24 |
# File 'lib/definition/types/keys.rb', line 22 def required_definitions @required_definitions end |
Instance Method Details
#conform(value) ⇒ Object
30 31 32 |
# File 'lib/definition/types/keys.rb', line 30 def conform(value) Conformer.new(self, value).conform end |
#keys ⇒ Object
34 35 36 |
# File 'lib/definition/types/keys.rb', line 34 def keys required_definitions.keys + optional_definitions.keys end |