Class: JsonRuleArray
- Inherits:
-
JsonRuleBase
- Object
- JsonRuleBase
- JsonRuleArray
- Defined in:
- lib/rules.rb
Instance Attribute Summary collapse
-
#max_count ⇒ Object
readonly
Returns the value of attribute max_count.
-
#min_count ⇒ Object
readonly
Returns the value of attribute min_count.
-
#unified_rule ⇒ Object
readonly
Returns the value of attribute unified_rule.
Instance Method Summary collapse
-
#initialize ⇒ JsonRuleArray
constructor
A new instance of JsonRuleArray.
- #set_count(min = nil, max = nil) ⇒ Object
- #set_rule(rule) ⇒ Object
Constructor Details
#initialize ⇒ JsonRuleArray
Returns a new instance of JsonRuleArray.
55 56 57 58 59 |
# File 'lib/rules.rb', line 55 def initialize @min_count = 0 @max_count = -1 @unified_rule = nil end |
Instance Attribute Details
#max_count ⇒ Object (readonly)
Returns the value of attribute max_count.
53 54 55 |
# File 'lib/rules.rb', line 53 def max_count @max_count end |
#min_count ⇒ Object (readonly)
Returns the value of attribute min_count.
53 54 55 |
# File 'lib/rules.rb', line 53 def min_count @min_count end |
#unified_rule ⇒ Object (readonly)
Returns the value of attribute unified_rule.
53 54 55 |
# File 'lib/rules.rb', line 53 def unified_rule @unified_rule end |
Instance Method Details
#set_count(min = nil, max = nil) ⇒ Object
66 67 68 69 70 |
# File 'lib/rules.rb', line 66 def set_count(min = nil, max = nil) @min_count = min unless min == nil @max_count = max unless max == nil self end |
#set_rule(rule) ⇒ Object
61 62 63 64 |
# File 'lib/rules.rb', line 61 def set_rule(rule) @unified_rule = rule self end |