Class: Lich::Gemstone::Society

Inherits:
Object
  • Object
show all
Defined in:
lib/attributes/society.rb

Overview

Represents the Society within the Gemstone module.

Class Method Summary collapse

Class Method Details

.favorInteger

Retrieves the current favor of the society.

Examples:

favor = Lich::Gemstone::Society.favor

Returns:

  • (Integer)

    the current favor of the society.

Raises:

  • (StandardError)

    if there is an issue retrieving the favor.



62
63
64
# File 'lib/attributes/society.rb', line 62

def self.favor
  Infomon.get('resources.voln_favor')
end

.memberString

Note:

The returned status is a copy, modifications to it will not affect the original.

Duplicates the current status of the society.

Examples:

member_status = Lich::Gemstone::Society.member

Returns:

  • (String)

    a duplicate of the current status of the society.



42
43
44
# File 'lib/attributes/society.rb', line 42

def self.member
  self.status.dup
end

.rankString

Retrieves the current rank of the society.

Examples:

rank = Lich::Gemstone::Society.rank

Returns:

  • (String)

    the current rank of the society.

Raises:

  • (StandardError)

    if there is an issue retrieving the rank.



22
23
24
# File 'lib/attributes/society.rb', line 22

def self.rank
  Infomon.get("society.rank")
end

.serializeArray<String>

Serializes the current status and rank of the society into an array.

Examples:

serialized_data = Lich::Gemstone::Society.serialize

Returns:

  • (Array<String>)

    an array containing the current status and rank of the society.



71
72
73
# File 'lib/attributes/society.rb', line 71

def self.serialize
  [self.status, self.rank]
end

.statusString

Retrieves the current status of the society.

Examples:

status = Lich::Gemstone::Society.status

Returns:

  • (String)

    the current status of the society.

Raises:

  • (StandardError)

    if there is an issue retrieving the status.



12
13
14
# File 'lib/attributes/society.rb', line 12

def self.status
  Infomon.get("society.status")
end

.stepString

Note:

This method is an alias for the rank method.

Retrieves the current step of the society, which is equivalent to its rank.

Examples:

step = Lich::Gemstone::Society.step

Returns:

  • (String)

    the current step of the society.



32
33
34
# File 'lib/attributes/society.rb', line 32

def self.step
  self.rank
end

.taskString

Retrieves the current task of the society from XML data.

Examples:

task = Lich::Gemstone::Society.task

Returns:

  • (String)

    the current task of the society.

Raises:

  • (StandardError)

    if there is an issue retrieving the task.



52
53
54
# File 'lib/attributes/society.rb', line 52

def self.task
  XMLData.society_task
end