Class: Craiggy::PostScraper
- Inherits:
-
Object
- Object
- Craiggy::PostScraper
- Defined in:
- lib/craiggy/post.rb
Overview
Scrapes and formats ‘post_params` for easy `Post` initialization
Instance Method Summary collapse
-
#initialize(page) ⇒ PostScraper
constructor
A new instance of PostScraper.
- #post_params ⇒ Object
Constructor Details
#initialize(page) ⇒ PostScraper
Returns a new instance of PostScraper.
24 25 26 |
# File 'lib/craiggy/post.rb', line 24 def initialize(page) @page = page end |
Instance Method Details
#post_params ⇒ Object
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/craiggy/post.rb', line 28 def post_params { image: image, title: title, price: price, location: location, description: description, url: page.uri.to_s, } end |