Sha256: 4eef3e11dd5cb324b43bba2a62dd12007b9defe85be423a36aec17524a5be366

Contents?: true

Size: 1.04 KB

Versions: 6

Compression:

Stored size: 1.04 KB

Contents

module Articles
  # Get a name for the entity with an indefinite article (unless the entity
  # has a proper name).
  #
  # @param entity [Gamefic::Entity]
  # @return [String]
  def a(entity)
    entity.indefinitely
  end
  alias an a

  # Get a name for the entity with a definite article (unless the entity has
  # a proper name).
  #
  # @param entity [Gamefic::Entity]
  # @return [String]
  def the(entity)
    entity.definitely
  end

  # Get a capitalized name for the entity with an indefinite article (unless
  # the entity has a proper name).
  #
  # @param entity [Gamefic::Entity]
  # @return [String]
  def a_(entity)
    entity.indefinitely.cap_first
  end
  alias an_ a_
  alias A a_
  alias An a_

  # Get a capitalized name for the entity with a definite article (unless
  # the entity has a proper name).
  #
  # @param entity [Gamefic::Entity]
  # @return [String]
  def the_(entity)
    entity.definitely.cap_first
  end
  alias The the_
end

# @todo Monkey patch
Gamefic::Narrative.include Articles

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
gamefic-standard-3.2.3 lib/gamefic-standard/articles.rb
gamefic-standard-3.2.2 lib/gamefic-standard/articles.rb
gamefic-standard-3.2.1 lib/gamefic-standard/articles.rb
gamefic-standard-3.2.0 lib/gamefic-standard/articles.rb
gamefic-standard-3.1.0 lib/gamefic-standard/articles.rb
gamefic-standard-3.0.0 lib/gamefic-standard/articles.rb