0.0
The project is in a healthy, maintained state
English grammar rules for Gamefic entities.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 13.0
~> 3.0
~> 0.22

Runtime

~> 3.0
 Project Readme

Gamefic::Grammar

English grammar rules for Gamefic entities.

Installation

If your project uses gamefic-standard, gamefic-grammar is already included.

Add the library to your Gamefic project's Gemfile:

gem 'gamefic-grammar'

Run bundle install.

Add the requirement to your project's code (typically in main.rb):

require 'gamefic-grammar'

## Usage

An entity's `gender` attribute can be `:male`, `:female`, `:neutral`, or `:other`. Default is `:neutral`.

```ruby
woman = Gamefic::Entity.new(name: 'woman', gender: :female)
woman.subjective #=> "she"
woman.objective  #=> "her"
woman.possessive #=> "her"
woman.reflexive  #=> "herself"

An entity's plural? attribute is boolean. Default is false.

shoes = Gamefic::Entity.new(name: 'shoes', plural: true)
shoes.plural? #=> true
"The #{shoes.name} #{shoes.maybe_plural('is', 'are')} red." #=> "The shoes are red."

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and the created tag, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/castwide/gamefic-grammar.