Class: JsonRuleObject

Inherits:
Object
  • Object
show all
Defined in:
lib/jsondef.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeJsonRuleObject

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_rulesObject (readonly)

Returns the value of attribute key_rules.



70
71
72
# File 'lib/jsondef.rb', line 70

def key_rules
  @key_rules
end

#keysObject (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_strictObject



82
83
84
85
# File 'lib/jsondef.rb', line 82

def set_strict
  @strict = true
  self
end

#strict?Boolean

Returns:

  • (Boolean)


78
79
80
# File 'lib/jsondef.rb', line 78

def strict?
  @strict
end