Class: Acme::Smileage::Blog::Ameblo
- Inherits:
-
Object
- Object
- Acme::Smileage::Blog::Ameblo
- Defined in:
- lib/acme/smileage/blog/ameblo.rb
Constant Summary collapse
- @@cache =
{}
Instance Attribute Summary collapse
-
#author ⇒ Object
readonly
Returns the value of attribute author.
-
#blog_link ⇒ Object
readonly
Returns the value of attribute blog_link.
Instance Method Summary collapse
- #get_entry_body(entry_header) ⇒ Object
- #get_entry_list(page = 1) ⇒ Object
-
#initialize(blog_link, author = nil) ⇒ Ameblo
constructor
A new instance of Ameblo.
Constructor Details
#initialize(blog_link, author = nil) ⇒ Ameblo
Returns a new instance of Ameblo.
13 14 15 16 17 |
# File 'lib/acme/smileage/blog/ameblo.rb', line 13 def initialize(blog_link, = nil) @blog_link = blog_link @author = @downloader = Acme::Smileage::Blog::AmebloDownloader.new end |
Instance Attribute Details
#author ⇒ Object (readonly)
Returns the value of attribute author.
11 12 13 |
# File 'lib/acme/smileage/blog/ameblo.rb', line 11 def @author end |
#blog_link ⇒ Object (readonly)
Returns the value of attribute blog_link.
11 12 13 |
# File 'lib/acme/smileage/blog/ameblo.rb', line 11 def blog_link @blog_link end |
Instance Method Details
#get_entry_body(entry_header) ⇒ Object
29 30 31 32 |
# File 'lib/acme/smileage/blog/ameblo.rb', line 29 def get_entry_body(entry_header) entry_link = coerce_entry_link(entry_header) @@cache[entry_link] ||= @downloader.get_entry_body(entry_link) end |
#get_entry_list(page = 1) ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'lib/acme/smileage/blog/ameblo.rb', line 19 def get_entry_list(page = 1) c = (@@cache[[self.blog_link, page]] ||= @downloader.get_entry_list(self, self.blog_link, page)) r = c.dup if self. r.entries = r.entries.select {|e| e. == self. } end r end |