Method: Choice::Option#to_a

Defined in:
lib/choice/option.rb

#to_aObject

Returns Option converted to an array.



71
72
73
74
75
76
# File 'lib/choice/option.rb', line 71

def to_a
  @choices.inject([]) do |array, choice|
    return array unless @choices.include? choice
    array + [instance_variable_get("@#{choice}")]
  end
end