Class: SRSGame::Item

Inherits:
Object show all
Defined in:
lib/srs_game.rb,
lib/srs_game.rb

Overview

:doc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ Item

params:

:name

Displayed when the item is regarded. (default: "Item")



168
169
170
# File 'lib/srs_game.rb', line 168

def initialize(params = {})
  @name = params[:name] or "Item"
end

Instance Attribute Details

#nameObject

Returns the value of attribute name



164
165
166
# File 'lib/srs_game.rb', line 164

def name
  @name
end

Instance Method Details

#to_sObject

Name of the item



173
174
175
# File 'lib/srs_game.rb', line 173

def to_s
  @name
end