Sha256: 1b7c7c1001860bd32718512cd6a5945d80642c2bbcc249a208e0a231e826c15a

Contents?: true

Size: 1 KB

Versions: 13

Compression:

Stored size: 1 KB

Contents

module Grammar
  # A collection of attributes that enable grammar features for entities, such
  # as selecting their correct pronouns.
  #
  module Attributes
    # @see #gender
    attr_writer :gender

    # @see #plural?
    attr_writer :plural

    # The gender of the object. Supported values are :male, :female, :neutral,
    # and :other. Use :neutral for objects that don't have a gender (i.e.,
    # "it"). Use :other for people or characters that have an unspecified or
    # non-binary gender (i.e., "they").
    #
    # @return [Symbol]
    def gender
      @gender ||= :neutral
    end

    # True if the object should be referred to in the plural, e.g., "they"
    # instead of "it."
    # @return [Boolean]
    #
    def plural?
      @plural ||= false
    end

    # For now, the object's person is always assumed to be third
    # (he/she/it/they). A future version of this library might support first
    # (I/me) and second (you).
    def person
      3
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
gamefic-standard-3.2.4 lib/gamefic-standard/grammar/attributes.rb
gamefic-standard-3.2.3 lib/gamefic-standard/grammar/attributes.rb
gamefic-standard-3.2.2 lib/gamefic-standard/grammar/attributes.rb
gamefic-standard-3.2.1 lib/gamefic-standard/grammar/attributes.rb
gamefic-standard-3.2.0 lib/gamefic-standard/grammar/attributes.rb
gamefic-standard-3.1.0 lib/gamefic-standard/grammar/attributes.rb
gamefic-standard-3.0.0 lib/gamefic-standard/grammar/attributes.rb
gamefic-standard-2.4.0 lib/gamefic-standard/grammar/attributes.rb
gamefic-standard-2.3.1 lib/gamefic-standard/grammar/attributes.rb
gamefic-standard-2.3.0 lib/gamefic-standard/grammar/attributes.rb
gamefic-standard-2.2.0 lib/gamefic-standard/grammar/attributes.rb
gamefic-standard-2.1.0 lib/gamefic-standard/grammar/attributes.rb
gamefic-standard-2.0.0 lib/gamefic-standard/grammar/attributes.rb