Class: R3EXS::Class::Learning

Inherits:
Object
  • Object
show all
Defined in:
lib/R3EXS/RGSS3_R3EXS.rb

Overview

职业[技能]的数据类

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(learning, index) ⇒ R3EXS::Class::Learning

用 RPG::Class::Learning 初始化

Parameters:

  • learning (RPG::Class::Learning) —

    待处理的 RPG::Class::Learning 对象

  • index (Integer) —

    在原始数组中的索引



1216
1217
1218
1219
# File 'lib/R3EXS/RGSS3_R3EXS.rb', line 1216

def initialize(learning, index)
  @index = index
  @note = learning.note
end

Instance Attribute Details

#index ⇒ Integer (readonly)

在原始数组中的索引

Returns:

  • (Integer)


1203
1204
1205
# File 'lib/R3EXS/RGSS3_R3EXS.rb', line 1203

def index
  @index
end

#note ⇒ String

备注

Returns:



1208
1209
1210
# File 'lib/R3EXS/RGSS3_R3EXS.rb', line 1208

def note
  @note
end

Instance Method Details

#empty? ⇒ Boolean

判断是否为空

Returns:

  • (Boolean)


1249
1250
1251
# File 'lib/R3EXS/RGSS3_R3EXS.rb', line 1249

def empty?
  @note.blank?
end

#ex_strings ⇒ Array<String>

提取所有的字符串

Returns:



1233
1234
1235
# File 'lib/R3EXS/RGSS3_R3EXS.rb', line 1233

def ex_strings
  [@note]
end

#in_strings(hash) ⇒ void

This method returns an undefined value.

将所有的字符串替换为指定的字符串

Parameters:



1242
1243
1244
# File 'lib/R3EXS/RGSS3_R3EXS.rb', line 1242

def in_strings(hash)
  @note = hash.fetch(@note, @note)
end

#inject_to(learning) ⇒ void

This method returns an undefined value.

注入到 RPG::Class::Learning 对象

Parameters:



1226
1227
1228
# File 'lib/R3EXS/RGSS3_R3EXS.rb', line 1226

def inject_to(learning)
  learning.note = @note
end