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.



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

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

Instance Method Details

#<<(value) ⇒ Object



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

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

#all_states!Object



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

def all_states!
  @all_states = true
  self
end

#all_states?Boolean

Returns:

  • (Boolean)


62
63
64
# File 'lib/super_state.rb', line 62

def all_states?
  @all_states
end

#for_selectObject



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

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

#include?(value) ⇒ Boolean

Returns:

  • (Boolean)


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

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