Class: Craig::Craigslist
- Inherits:
-
Object
- Object
- Craig::Craigslist
- Defined in:
- lib/craig/craigslist.rb
Overview
Translates our gem’s inputs into the request to fetch Craigslist listings.
Instance Attribute Summary collapse
-
#category ⇒ Object
readonly
Returns the value of attribute category.
-
#city ⇒ Object
readonly
Returns the value of attribute city.
-
#subcategory ⇒ Object
readonly
Returns the value of attribute subcategory.
Instance Method Summary collapse
-
#initialize(city, categories) ⇒ Craigslist
constructor
A new instance of Craigslist.
- #listings ⇒ Object
Constructor Details
#initialize(city, categories) ⇒ Craigslist
Returns a new instance of Craigslist.
7 8 9 10 |
# File 'lib/craig/craigslist.rb', line 7 def initialize(city, categories) @city = city @category, @subcategory = *Array(categories).flatten end |
Instance Attribute Details
#category ⇒ Object (readonly)
Returns the value of attribute category.
5 6 7 |
# File 'lib/craig/craigslist.rb', line 5 def category @category end |
#city ⇒ Object (readonly)
Returns the value of attribute city.
5 6 7 |
# File 'lib/craig/craigslist.rb', line 5 def city @city end |
#subcategory ⇒ Object (readonly)
Returns the value of attribute subcategory.
5 6 7 |
# File 'lib/craig/craigslist.rb', line 5 def subcategory @subcategory end |