module SmartAnswer
  module Question
    class MultipleChoice < Base
      attr_reader :permitted_options

      def initialize(flow, name, options = {}, &block)
        @permitted_options = []
        super
      end

      def option(transitions, options = {})
        [*transitions].each { |option| @permitted_options << option.to_s }
      end

      def options
        @permitted_options
      end

      def valid_option?(option)
        options.include?(option.to_s)
      end

      def parse_input(raw_input)
        raise SmartAnswer::InvalidResponse, "Illegal option #{raw_input} for #{name}", caller unless valid_option?(raw_input)
        super
      end
    end
  end
end

module SmartAnswer
  module Question
    class MultipleChoice < Base
      attr_reader :permitted_options

      def initialize(flow, name, options = {}, &block)
        @permitted_options = []
        super
      end

      def option(option_key, options = {})
        @permitted_options << option_key.to_s
      end

      def options
        @permitted_options
      end

      def valid_option?(option)
        options.include?(option.to_s)
      end

      def parse_input(raw_input)
        raise SmartAnswer::InvalidResponse, "Illegal option #{raw_input} for #{name}", caller unless valid_option?(raw_input)
        super
      end
    end
  end
end

Remove ability to specify multiple options
Remove ability to specify multiple options

I hadn't noticed that this was even possible until removing the ability to pass
a hash of options and next nodes. Irrespective, we're not using this ability so
I'm removing it.
