lib/pinboard/client.rb in pinboard-0.0.2 vs lib/pinboard/client.rb in pinboard-0.0.3

- old
+ new

@@ -8,12 +8,16 @@ def initialize(options={}) @auth = { :username => options[:username], :password => options[:password] } end - def posts - options = { :basic_auth => @auth } + def posts(params={}) + options = {} + options[:basic_auth] = @auth + options[:query] = params posts = self.class.get('/posts/all', options)['posts']['post'] - posts.map { |p| Post.new(Util.symbolize_keys(p)) } + if !posts.nil? + posts.map { |p| Post.new(Util.symbolize_keys(p)) } + end end end end