Class: Zakuro::Exception::Case::Template
- Inherits:
-
Object
- Object
- Zakuro::Exception::Case::Template
- Defined in:
- lib/zakuro/exception/case/template.rb
Overview
Template テンプレート
Instance Attribute Summary collapse
-
#code ⇒ String
readonly
エラーコード.
-
#length ⇒ Integer
readonly
テンプレート引数長.
-
#message ⇒ String
readonly
メッセージ.
Instance Method Summary collapse
-
#format(*args) ⇒ String
メッセージを作成する.
-
#initialize(code:, message:, length: 0) ⇒ Template
constructor
初期化.
Constructor Details
#initialize(code:, message:, length: 0) ⇒ Template
初期化
27 28 29 30 31 |
# File 'lib/zakuro/exception/case/template.rb', line 27 def initialize(code:, message:, length: 0) @code = code @message = @length = length end |
Instance Attribute Details
#code ⇒ String (readonly)
Returns エラーコード.
14 15 16 |
# File 'lib/zakuro/exception/case/template.rb', line 14 def code @code end |
#length ⇒ Integer (readonly)
Returns テンプレート引数長.
18 19 20 |
# File 'lib/zakuro/exception/case/template.rb', line 18 def length @length end |
#message ⇒ String (readonly)
Returns メッセージ.
16 17 18 |
# File 'lib/zakuro/exception/case/template.rb', line 16 def @message end |
Instance Method Details
#format(*args) ⇒ String
メッセージを作成する
40 41 42 43 44 |
# File 'lib/zakuro/exception/case/template.rb', line 40 def format(*args) return '' unless args.size == length super(, *args) end |