Sha256: f7a410cfbd8d1af95f706d7fe3a45e836d5fc8810932af7c1e82e39c8aa36b7a
Contents?: true
Size: 1.2 KB
Versions: 29
Compression:
Stored size: 1.2 KB
Contents
module FbGraph class Checkin < Node extend Searchable attr_accessor :from, :tags, :place, :message, :application, :created_time def initialize(identifier, attributes = {}) super if (from = attributes[:from]) @from = User.new(from[:id], from) end @tags = [] if (tags = attributes[:tags]) case tags when Hash Collection.new(tags).each do |user| @tags << User.new(user[:id], user) end when String, Array Array(tags).each do |user_id| @tags << User.new(user_id) end end end if (place = attributes[:place]) @place = case place when Place place when String, Integer Place.new(place) when Hash Place.new(place[:id], place) end end @message = attributes[:message] if (application = attributes[:application]) @application = Application.new(application[:id], application) end if (created_time = attributes[:created_time]) @created_time = Time.parse(created_time).utc end end def self.search(options = {}) super(nil, options) end end end
Version data entries
29 entries across 29 versions & 1 rubygems