Class: SuperState::StateArray

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

Overview

I want to know the states are the same

Instance Method Summary collapse

Constructor Details

#initialize(array = nil) ⇒ StateArray

Returns a new instance of StateArray.



34
35
36
# File 'lib/super_state.rb', line 34

def initialize(array=nil)
  super(SuperState.canonicalise(Array(array)))
end

Instance Method Details

#<<(value) ⇒ Object



38
39
40
# File 'lib/super_state.rb', line 38

def <<(value)
  super(SuperState.canonicalise(value))
end

#all_states!Object



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

def all_states!
  @all_states = true
  self
end

#all_states?Boolean

Returns:

  • (Boolean)


57
58
59
# File 'lib/super_state.rb', line 57

def all_states?
  @all_states
end

#for_selectObject



46
47
48
49
50
# File 'lib/super_state.rb', line 46

def for_select
  self.map do |value|
    [value.humanize, value]
  end
end

#include?(value) ⇒ Boolean

Returns:

  • (Boolean)


42
43
44
# File 'lib/super_state.rb', line 42

def include?(value)
  super(SuperState.canonicalise(value))
end