Module: Gamefic::Standard::Articles

Included in:
Gamefic::Standard
Defined in:
lib/gamefic-standard/articles.rb

Overview

Methods for adding definite and indefinite articles to entity names.

Instance Method Summary collapse

Instance Method Details

#a(entity) ⇒ String Also known as: an

Get a name for the entity with an indefinite article (unless the entity has a proper name).

Parameters:

  • entity (Gamefic::Entity)

Returns:

  • (String)


13
14
15
# File 'lib/gamefic-standard/articles.rb', line 13

def a(entity)
  entity.indefinitely
end

#a_(entity) ⇒ String Also known as: an_, A, An

Get a capitalized name for the entity with an indefinite article (unless the entity has a proper name).

Parameters:

  • entity (Gamefic::Entity)

Returns:

  • (String)


32
33
34
# File 'lib/gamefic-standard/articles.rb', line 32

def a_(entity)
  entity.indefinitely.cap_first
end

#the(entity) ⇒ String

Get a name for the entity with a definite article (unless the entity has a proper name).

Parameters:

  • entity (Gamefic::Entity)

Returns:

  • (String)


23
24
25
# File 'lib/gamefic-standard/articles.rb', line 23

def the(entity)
  entity.definitely
end

#the_(entity) ⇒ String Also known as: The

Get a capitalized name for the entity with a definite article (unless the entity has a proper name).

Parameters:

  • entity (Gamefic::Entity)

Returns:

  • (String)


44
45
46
# File 'lib/gamefic-standard/articles.rb', line 44

def the_(entity)
  entity.definitely.cap_first
end