module Memorization

Adds capability to memorize things such as URLs, etc. Most variables are stored here.

Public Instance Methods

find_posts_url() click to toggle source

Searches page for link that says Articles or Blog.

# File lib/blogbot/memorization.rb, line 5
def find_posts_url
  @article_link = @current_page.link_with(text: /Articles/)
  @blog_link = @current_page.link_with(text: /Blog/)
end
store_indicator() click to toggle source

Sets search indicator to whatever had ‘Popular’ in its text.

# File lib/blogbot/memorization.rb, line 22
def store_indicator
  @indicator = @current_page.search("[text()*='Popular']").first
end
store_posts_url() click to toggle source

Memorize posts_url found by find_posts.

# File lib/blogbot/memorization.rb, line 11
def store_posts_url
  @posts_url =
    case
    when @article_link.nil? == false
      @article_link
    when @blog_link.nil? == false
      @blog_link
    end
end