Sha256: c77ee19c75500436ede37ac9bd4b11348196176c2dedef74b8bdef682a8238fd

Contents?: true

Size: 371 Bytes

Versions: 8

Compression:

Stored size: 371 Bytes

Contents

# frozen_string_literal: true

module Gamefic
  module Props
    # A MultipleChoice variant that only allows Yes or No.
    #
    class YesOrNo < MultipleChoice
      def yes?
        selection == 'Yes'
      end

      def no?
        selection == 'No'
      end

      def options
        @options ||= %w[Yes No].freeze
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
gamefic-3.6.0 lib/gamefic/props/yes_or_no.rb
gamefic-3.5.0 lib/gamefic/props/yes_or_no.rb
gamefic-3.4.0 lib/gamefic/props/yes_or_no.rb
gamefic-3.3.0 lib/gamefic/props/yes_or_no.rb
gamefic-3.2.1 lib/gamefic/props/yes_or_no.rb
gamefic-3.2.0 lib/gamefic/props/yes_or_no.rb
gamefic-3.1.0 lib/gamefic/props/yes_or_no.rb
gamefic-3.0.0 lib/gamefic/props/yes_or_no.rb