Class: WebAuthor::Page
- Inherits:
-
Object
- Object
- WebAuthor::Page
- Extended by:
- T::Sig
- Defined in:
- lib/web_author/page.rb
Instance Attribute Summary collapse
-
#page_content ⇒ Object
readonly
Returns the value of attribute page_content.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
- #author ⇒ Object
-
#initialize(url:) ⇒ Page
constructor
A new instance of Page.
Constructor Details
#initialize(url:) ⇒ Page
Returns a new instance of Page.
15 16 17 18 |
# File 'lib/web_author/page.rb', line 15 def initialize(url:) @url = T.let(url, String) @page_content = T.let(nil, T.nilable(Nokogiri::XML::Document)) end |
Instance Attribute Details
#page_content ⇒ Object (readonly)
Returns the value of attribute page_content.
12 13 14 |
# File 'lib/web_author/page.rb', line 12 def page_content @page_content end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
9 10 11 |
# File 'lib/web_author/page.rb', line 9 def url @url end |
Instance Method Details
#author ⇒ Object
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/web_author/page.rb', line 21 def fetch_page_content unless page_content STRATEGIES.each do |strategy_class| = strategy_class.new(T.must(page_content)). return if end nil end |