Exception: S7::DataLengthError

Inherits:
ApplicationError show all
Defined in:
lib/s7/exception.rb

Overview

データ長が不正であることを表現する例外クラス。

Instance Method Summary collapse

Methods included from GetText

#N_, #_, bindtextdomain, included

Constructor Details

#initialize(actual, needed) ⇒ DataLengthError

Returns a new instance of DataLengthError.



84
85
86
87
# File 'lib/s7/exception.rb', line 84

def initialize(actual, needed)
  @actual = actual
  @needed = needed
end

Instance Method Details

#to_sObject



89
90
91
# File 'lib/s7/exception.rb', line 89

def to_s
  return _("Invalid data length: actual=<%s> needed=<%s>") % [@actual, @needed]
end