Class: JsonRuleObjectKey
- Inherits:
-
Object
- Object
- JsonRuleObjectKey
- Defined in:
- lib/jsondef.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#required ⇒ Object
readonly
Returns the value of attribute required.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(key) ⇒ JsonRuleObjectKey
constructor
A new instance of JsonRuleObjectKey.
- #set_optional ⇒ Object
- #set_value_rule(rule) ⇒ Object
- #set_value_type(type) ⇒ Object
Constructor Details
#initialize(key) ⇒ JsonRuleObjectKey
Returns a new instance of JsonRuleObjectKey.
106 107 108 109 110 |
# File 'lib/jsondef.rb', line 106 def initialize(key) @key = key @required = true @value = :wildcard end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
104 105 106 |
# File 'lib/jsondef.rb', line 104 def key @key end |
#required ⇒ Object (readonly)
Returns the value of attribute required.
104 105 106 |
# File 'lib/jsondef.rb', line 104 def required @required end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
104 105 106 |
# File 'lib/jsondef.rb', line 104 def value @value end |
Instance Method Details
#set_optional ⇒ Object
112 113 114 115 |
# File 'lib/jsondef.rb', line 112 def set_optional() @required = false self end |
#set_value_rule(rule) ⇒ Object
122 123 124 125 |
# File 'lib/jsondef.rb', line 122 def set_value_rule(rule) @value = rule self end |
#set_value_type(type) ⇒ Object
117 118 119 120 |
# File 'lib/jsondef.rb', line 117 def set_value_type(type) @value = type self end |