Exception: QiitaTrend::Error::NotExistsCacheError

Inherits:
SyntaxError
  • Object
show all
Defined in:
lib/qiita_trend/error/not_exists_cache_error.rb

Overview

キャッシュファイルが存在しない時に発生するエラークラス キャッシュファイルからトレンドを取得する時、存在しないキャッシュファイルを指定した時に発生する

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cache) ⇒ NotExistsCacheError

コンストラクタ

Parameters:

  • cache (Cache)

    キャッシュクラス



14
15
16
17
# File 'lib/qiita_trend/error/not_exists_cache_error.rb', line 14

def initialize(cache)
  super
  @cache = cache
end

Instance Attribute Details

#cacheCache (readonly)

Returns Cacheクラス.

Returns:

  • (Cache)

    Cacheクラス



9
10
11
# File 'lib/qiita_trend/error/not_exists_cache_error.rb', line 9

def cache
  @cache
end

Instance Method Details

#messageString

エラーメッセージを返します 読み込もうとしたキャッシュファイルのフルパス含んだ形でメッセージを返します

Returns:

  • (String)

    エラーメッセージ



23
24
25
# File 'lib/qiita_trend/error/not_exists_cache_error.rb', line 23

def message
  "Does not exist cache file #{@cache.full_path}"
end