Sha256: 10c256479dce9ee62a3242bc6052f8fdf76d4d79604ed839a357a1fb4de75123
Contents?: true
Size: 646 Bytes
Versions: 2
Compression:
Stored size: 646 Bytes
Contents
module Pinboard class Post < Struct.new(:href, :description, :extended, :tag, :time, :replace, :shared, :toread) def self.all(options={}) client = Pinboard::Client.new(options) posts = client.class.get('/posts/all', :basic_auth => options)['posts']['post'] posts.map { |p| Post.new(Util.symbolize_keys(p)) } end def initialize(attributes={}) self.time = Util.parse_time(attributes.delete(:time)) self.tag = attributes.delete(:tag).split(" ") attributes.each do |attribute, value| send("#{attribute}=", value) if respond_to?("#{attribute}=") end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
pinboard-0.0.51 | lib/pinboard/post.rb |
pinboard-0.0.5 | lib/pinboard/post.rb |