Class: Livedoor::API::FeedDiscover::Feed
- Inherits:
-
Object
- Object
- Livedoor::API::FeedDiscover::Feed
- Defined in:
- lib/livedoor/api/feed_discover/feed.rb
Instance Method Summary collapse
- #avg_rate ⇒ Object
- #description ⇒ Object
- #feedlink ⇒ Object
- #icon ⇒ Object
- #image ⇒ Object
-
#initialize(json) ⇒ Feed
constructor
A new instance of Feed.
- #link ⇒ Object
- #modified_on ⇒ Object
- #official? ⇒ Boolean
- #source ⇒ Object
- #subscribers_count ⇒ Object
- #thirdparty? ⇒ Boolean
- #title ⇒ Object
Constructor Details
#initialize(json) ⇒ Feed
Returns a new instance of Feed.
6 7 8 9 |
# File 'lib/livedoor/api/feed_discover/feed.rb', line 6 def initialize(json) @json = json.dup @json.each_value{|e| e.freeze } end |
Instance Method Details
#avg_rate ⇒ Object
39 40 41 |
# File 'lib/livedoor/api/feed_discover/feed.rb', line 39 def avg_rate @json["avg_rate"] end |
#description ⇒ Object
35 36 37 |
# File 'lib/livedoor/api/feed_discover/feed.rb', line 35 def description @json["description"] end |
#feedlink ⇒ Object
19 20 21 |
# File 'lib/livedoor/api/feed_discover/feed.rb', line 19 def feedlink @json["feedlink"] end |
#icon ⇒ Object
23 24 25 |
# File 'lib/livedoor/api/feed_discover/feed.rb', line 23 def icon @json["icon"] end |
#image ⇒ Object
27 28 29 |
# File 'lib/livedoor/api/feed_discover/feed.rb', line 27 def image @json["image"] end |
#link ⇒ Object
15 16 17 |
# File 'lib/livedoor/api/feed_discover/feed.rb', line 15 def link @json["link"] end |
#modified_on ⇒ Object
47 48 49 50 |
# File 'lib/livedoor/api/feed_discover/feed.rb', line 47 def modified_on v = @json["modified_on"] Time.at(v) if v and Integer === v end |
#official? ⇒ Boolean
52 53 54 55 56 57 58 59 |
# File 'lib/livedoor/api/feed_discover/feed.rb', line 52 def official? v = @json["official"] if v and Integer === v and v == 1 true else false end end |
#source ⇒ Object
11 12 13 |
# File 'lib/livedoor/api/feed_discover/feed.rb', line 11 def source @json["source"] end |
#subscribers_count ⇒ Object
43 44 45 |
# File 'lib/livedoor/api/feed_discover/feed.rb', line 43 def subscribers_count @json["subscribers_count"] end |
#thirdparty? ⇒ Boolean
61 62 63 |
# File 'lib/livedoor/api/feed_discover/feed.rb', line 61 def thirdparty? not official? and URI(link).host != URI(feedlink).host end |
#title ⇒ Object
31 32 33 |
# File 'lib/livedoor/api/feed_discover/feed.rb', line 31 def title @json["title"] end |