Class: JsonRuleObject
- Inherits:
-
Object
- Object
- JsonRuleObject
- Defined in:
- lib/jsondef.rb
Instance Attribute Summary collapse
-
#key_rules ⇒ Object
readonly
Returns the value of attribute key_rules.
-
#keys ⇒ Object
readonly
Returns the value of attribute keys.
Instance Method Summary collapse
- #add_key_rule(rule) ⇒ Object
-
#initialize ⇒ JsonRuleObject
constructor
A new instance of JsonRuleObject.
- #set_strict ⇒ Object
- #strict? ⇒ Boolean
Constructor Details
#initialize ⇒ JsonRuleObject
Returns a new instance of JsonRuleObject.
72 73 74 75 76 |
# File 'lib/jsondef.rb', line 72 def initialize() @strict = false @key_rules = [] @keys = [] end |
Instance Attribute Details
#key_rules ⇒ Object (readonly)
Returns the value of attribute key_rules.
70 71 72 |
# File 'lib/jsondef.rb', line 70 def key_rules @key_rules end |
#keys ⇒ Object (readonly)
Returns the value of attribute keys.
70 71 72 |
# File 'lib/jsondef.rb', line 70 def keys @keys end |
Instance Method Details
#add_key_rule(rule) ⇒ Object
87 88 89 90 91 |
# File 'lib/jsondef.rb', line 87 def add_key_rule(rule) @key_rules.push(rule) @keys.push(rule.key) self end |
#set_strict ⇒ Object
82 83 84 85 |
# File 'lib/jsondef.rb', line 82 def set_strict @strict = true self end |
#strict? ⇒ Boolean
78 79 80 |
# File 'lib/jsondef.rb', line 78 def strict? @strict end |