Single Responsibility Principle
A class should have only a single responsibility.
A class should have only one reason to change.
We have couple of parts
1. Configuration - line 10, 11
2. Logging - line 13
3. http Layer - line 14, 16
4. Responce - line 18-26
So move it all to other services
1. BlogServiceConfig
2. Logger
3. Requests
4. Response Processor
And Service
blog_service = BlogService.new
puts blog_service.posts.inspect
http://rubyblog.pro
Comments
Post a Comment