Class: JCR::ArrayBehavior

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(current_behavior = nil) ⇒ ArrayBehavior

Returns a new instance of ArrayBehavior.



32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/jcr/evaluate_array_rules.rb', line 32

def initialize( current_behavior = nil )
  if current_behavior
    @checked_hash = {}
    @checked_hash.merge!( current_behavior.checked_hash )
    @last_index = current_behavior.last_index
    @ordered = current_behavior.ordered
    @extra_prohibited = false
  else
    @checked_hash = {}
    @last_index = 0
    @ordered = true
    @extra_prohibited = true
  end
end

Instance Attribute Details

#checked_hashObject

Returns the value of attribute checked_hash.



30
31
32
# File 'lib/jcr/evaluate_array_rules.rb', line 30

def checked_hash
  @checked_hash
end

#extra_prohibitedObject

Returns the value of attribute extra_prohibited.



30
31
32
# File 'lib/jcr/evaluate_array_rules.rb', line 30

def extra_prohibited
  @extra_prohibited
end

#last_indexObject

Returns the value of attribute last_index.



30
31
32
# File 'lib/jcr/evaluate_array_rules.rb', line 30

def last_index
  @last_index
end

#orderedObject

Returns the value of attribute ordered.



30
31
32
# File 'lib/jcr/evaluate_array_rules.rb', line 30

def ordered
  @ordered
end