All notable changes to this project will be documented in this file. This project adheres to Semantic Versioning.
-
Ability to specify flavor upon initialization
client = Skroutz::Client.new('client_id', 'client_secret', flavor: :scrooge) # client now points to scrooge.co.uk for authentication and API requests
- Resource classes are namespaced under Skroutz::Resources
- Skroutz::Client#token= for setting a pre-obtained OAuth2.0 access token
- Favorite <- Sku assoiciation
- FavoriteList <- Favorite association
- JSON serialization capability of Skroutz::Resource
- reload! method for code reloading in development
- Skroutz::Resource#resource handling for multiple word resources (eg. FavoriteList)
- addressable gem dependency
- Associations. Read More
- Favorite Lists. User favorite lists can be fetched
Example:client = Skroutz::Client.new('', '') client.user_token = 'a valid user token' client.favorite_lists.all
- Skroutz::Client#user_token and Skroutz::Client#user_token=
- Reviews. The reviews of a SKU can be fetched
Example:client.skus(42).reviews
- Specifications. The specifications of a SKU can be fetched
Example:client.skus(42).specifications
- Locations. The locations of a Shop can be fetched
Example:client.shops(42).locations # GET /shops/42/locations
- Rate-limiting error handling, when a request fails due to
rate-limiting,
Skroutz::RateLimitingError
is raised - For all methods which perform a request, the HTTP verb can be
specified using either the
:verb
, or:via
options
Example:client.categories.all(via: :post) # POST /categories
- Direct association requests. Intermediate requests for nested
resources can be avoided
Example:client.categories(42).skus # Performs 1 request to /categories/42/sks
Skroutz::Client#autocomplete
- AR-like resource inspection using
Skroutz::Resource#inspect
- All collections respond to
#meta
with contains response metadata
- Direct instantiation of abstract class
Skroutz::CollectionProxy
raisesRuntimeError
- Responses with status 401 Unauthorized raise
Skroutz::UnauthorizedError
- Responses with status 400 Bad Request raise
Skroutz::ClientError
- Resource attribute predicate methods always return boolean values
Example:
client.skus.find(42).virtual? # => false
- The name of the gem to
skroutz
fromskroutz_api
and the namespace toSkroutz
fromSkroutzApi
accordingly Skroutz::PaginatedCollection#is_at_last_page?
is renamed to#last_page?
Skroutz::PaginatedCollection#is_at_first_page?
is renamed to#first_page?
- Trying to fetch a non-existant page returns nil instead of empty Array
- Pagination methods depend only on link headers
- Resources and collections are automatically inferred at parsing based on the root key of the JSON response
- Properly handle requests and parsing of two_word resources (eg. filter_groups)
- Make
Skroutz::Client#search
work
- Make response timeout configurable (in seconds)
- Make HTTP adapter configurable
- Make response logger configurable
- Memoization in SkroutzApi::Resource#resource now works as expected