lib/blog_api.rb in blog_api-1.0.0 vs lib/blog_api.rb in blog_api-2.0.0

- old
+ new

@@ -1,5 +1,36 @@ require './lib/blog_api/version' -require './lib/blog_api/request' -require './lib/blog_api/post' -require './lib/blog_api/category' -require './lib/blog_api/tag' +require './lib/blog_api/client' +require './lib/blog_api/configuration' + +module BlogApi + attr_accessor :configuration + class << self + def configuration + @configuration = BlogApi::Configuration.new + end + + def client + BlogApi::Client.new(configuration) + end + + def categories + client.get('categories') + end + + def posts + client.get('posts') + end + + def post(post_id) + client.get("posts/#{post_id}") + end + + def featured_posts + client.get("featured_posts") + end + + def tags + client.get("tags") + end + end +end