Module: Gamefic::Standard::Articles

Extended by:
Gamefic::Scriptable
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)


15
16
17
# File 'lib/gamefic/standard/articles.rb', line 15

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)


34
35
36
# File 'lib/gamefic/standard/articles.rb', line 34

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)


25
26
27
# File 'lib/gamefic/standard/articles.rb', line 25

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)


46
47
48
# File 'lib/gamefic/standard/articles.rb', line 46

def the_(entity)
  entity.definitely.cap_first
end