Class: QiitaTrend::Target

Inherits:
Object
  • Object
show all
Defined in:
lib/qiita_trend/target.rb

Overview

Qiitaの対象のトレンドの機能を提供する

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(trend_type = TrendType::DAILY, date = nil) ⇒ Target

コンストラクタ


19
20
21
22
23
24
# File 'lib/qiita_trend/target.rb', line 19

def initialize(trend_type = TrendType::DAILY, date = nil)
  @type = trend_type
  @url = trend_url(trend_type)
  @need_login = trend_type != TrendType::DAILY
  @cache = cache_name(trend_type, date)
end

Instance Attribute Details

#cacheString (readonly)


13
14
15
# File 'lib/qiita_trend/target.rb', line 13

def cache
  @cache
end

#need_loginBoolean (readonly)


11
12
13
# File 'lib/qiita_trend/target.rb', line 11

def 
  @need_login
end

#typeTrendType (readonly)


7
8
9
# File 'lib/qiita_trend/target.rb', line 7

def type
  @type
end

#urlString (readonly)


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

def url
  @url
end