Class: JsonRuleObjectKey
- Inherits:
-
Object
- Object
- JsonRuleObjectKey
- Defined in:
- lib/rules.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#required ⇒ Object
readonly
Returns the value of attribute required.
-
#rule ⇒ Object
readonly
Returns the value of attribute rule.
Instance Method Summary collapse
-
#initialize(key) ⇒ JsonRuleObjectKey
constructor
A new instance of JsonRuleObjectKey.
- #set_optional ⇒ Object
- #set_rule(rule) ⇒ Object
Constructor Details
#initialize(key) ⇒ JsonRuleObjectKey
Returns a new instance of JsonRuleObjectKey.
32 33 34 35 36 |
# File 'lib/rules.rb', line 32 def initialize(key) @key = key @required = true @rule = JsonDef::ANY_TYPE end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
30 31 32 |
# File 'lib/rules.rb', line 30 def key @key end |
#required ⇒ Object (readonly)
Returns the value of attribute required.
30 31 32 |
# File 'lib/rules.rb', line 30 def required @required end |
#rule ⇒ Object (readonly)
Returns the value of attribute rule.
30 31 32 |
# File 'lib/rules.rb', line 30 def rule @rule end |
Instance Method Details
#set_optional ⇒ Object
39 40 41 42 |
# File 'lib/rules.rb', line 39 def set_optional @required = false self end |
#set_rule(rule) ⇒ Object
44 45 46 47 |
# File 'lib/rules.rb', line 44 def set_rule(rule) @rule = rule self end |