Class: InstaScraper::HTML::Media
- Inherits:
-
InstaScraper::HTML
- Object
- InstaScraper::HTML
- InstaScraper::HTML::Media
- Defined in:
- lib/insta_scraper/html/media.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
-
#initialize(code = nil, html = nil, params = {}) ⇒ Media
constructor
A new instance of Media.
- #url ⇒ Object
Methods inherited from InstaScraper::HTML
Constructor Details
#initialize(code = nil, html = nil, params = {}) ⇒ Media
Returns a new instance of Media.
6 7 8 9 10 11 12 |
# File 'lib/insta_scraper/html/media.rb', line 6 def initialize(code = nil, html = nil, params = {}) raise ArgumentError, 'Provide a code or html string' if !code && !html @code = code @html = html @params = params end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
3 4 5 |
# File 'lib/insta_scraper/html/media.rb', line 3 def code @code end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
3 4 5 |
# File 'lib/insta_scraper/html/media.rb', line 3 def params @params end |
Instance Method Details
#url ⇒ Object
14 15 16 |
# File 'lib/insta_scraper/html/media.rb', line 14 def url "https://www.instagram.com/p/#{code}/#{serialize_params}" end |