Class: JsonRuleArray

Inherits:
JsonRuleBase show all
Defined in:
lib/rules.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeJsonRuleArray

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

Returns the value of attribute max_count.



53
54
55
# File 'lib/rules.rb', line 53

def max_count
  @max_count
end

#min_countObject (readonly)

Returns the value of attribute min_count.



53
54
55
# File 'lib/rules.rb', line 53

def min_count
  @min_count
end

#unified_ruleObject (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