Class: QiitaTrend::Target
- Inherits:
-
Object
- Object
- QiitaTrend::Target
- Defined in:
- lib/qiita_trend/target.rb
Instance Attribute Summary collapse
-
#cache ⇒ Object
readonly
Returns the value of attribute cache.
-
#need_login ⇒ Object
readonly
Returns the value of attribute need_login.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(trend_type = TrendType::DAILY, date = nil) ⇒ Target
constructor
A new instance of Target.
Constructor Details
#initialize(trend_type = TrendType::DAILY, date = nil) ⇒ Target
Returns a new instance of Target.
7 8 9 10 11 12 |
# File 'lib/qiita_trend/target.rb', line 7 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
#cache ⇒ Object (readonly)
Returns the value of attribute cache.
5 6 7 |
# File 'lib/qiita_trend/target.rb', line 5 def cache @cache end |
#need_login ⇒ Object (readonly)
Returns the value of attribute need_login.
5 6 7 |
# File 'lib/qiita_trend/target.rb', line 5 def need_login @need_login end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
5 6 7 |
# File 'lib/qiita_trend/target.rb', line 5 def type @type end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
5 6 7 |
# File 'lib/qiita_trend/target.rb', line 5 def url @url end |