Class: Irasutoya::IrasutoLink
- Inherits:
-
Object
- Object
- Irasutoya::IrasutoLink
- Defined in:
- lib/irasutoya/irasuto_link.rb
Instance Attribute Summary collapse
-
#show_url ⇒ Object
readonly
Returns the value of attribute show_url.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
- #fetch_irasuto ⇒ Object
-
#initialize(title:, show_url:) ⇒ IrasutoLink
constructor
A new instance of IrasutoLink.
Methods included from Modules::HasShowPageParser
Methods included from Modules::HasDocumentFetcher
Constructor Details
#initialize(title:, show_url:) ⇒ IrasutoLink
Returns a new instance of IrasutoLink.
10 11 12 13 |
# File 'lib/irasutoya/irasuto_link.rb', line 10 def initialize(title:, show_url:) @title = title @show_url = show_url end |
Instance Attribute Details
#show_url ⇒ Object (readonly)
Returns the value of attribute show_url.
8 9 10 |
# File 'lib/irasutoya/irasuto_link.rb', line 8 def show_url @show_url end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
8 9 10 |
# File 'lib/irasutoya/irasuto_link.rb', line 8 def title @title end |
Instance Method Details
#fetch_irasuto ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/irasutoya/irasuto_link.rb', line 15 def fetch_irasuto document = fetch_page_and_parse(show_url) parsed = parse_show_page(document: document) Irasuto.new( url: show_url, title: parsed[:title], description: parsed[:description], image_urls: parsed[:image_urls] ) end |