Class: Cwsrb::Language::Type

Inherits:
Object
  • Object
show all
Defined in:
lib/cwsrb/data.rb

Overview

The Type class represents a language type of ConWorkShop.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code: '', desc: '') ⇒ Type

Initializes a new Type instance with an options hash.

Parameters:

  • code (String) (defaults to: '')

    The three-character type code. Defaults to an empty string.

  • desc (String) (defaults to: '')

    The description for the type. Defaults to an empty string.


77
78
79
80
# File 'lib/cwsrb/data.rb', line 77

def initialize(code: '', desc: '')
  @code = code
  @desc = desc
end

Instance Attribute Details

#codeString (readonly)

Returns The three-character type code.

Returns:

  • (String)

    The three-character type code.


66
67
68
# File 'lib/cwsrb/data.rb', line 66

def code
  @code
end

#descString (readonly)

Returns The description for the type.

Returns:

  • (String)

    The description for the type.


69
70
71
# File 'lib/cwsrb/data.rb', line 69

def desc
  @desc
end

Instance Method Details

#inspectString

inspect method, with all of Type's attributes.

Returns:

  • (String)

    A more meaningful output than that of the default


85
86
87
# File 'lib/cwsrb/data.rb', line 85

def inspect
  "<Language::Type code=#{@code} desc=#{@desc}>"
end