Sha256: 3a39febef4b3b493d874cca29dae357eef03fc0e9daf1af9ac65430cfaa62709
Contents?: true
Size: 806 Bytes
Versions: 15
Compression:
Stored size: 806 Bytes
Contents
module FbGraph class Comment < Node include Connections::Comments include Connections::Likes include Connections::Likes::Likable attr_accessor :from, :message, :created_time, :like_count, :can_comment def initialize(identifier, attributes = {}) super if (from = attributes[:from]) @from = if from[:category] Page.new(from[:id], from) else User.new(from[:id], from) end end @message = attributes[:message] @like_count = attributes[:likes] @can_comment = attributes[:can_comment] if attributes[:created_time] @created_time = Time.parse(attributes[:created_time]).utc end end def can_comment? !!can_comment end alias_method :commentable?, :can_comment end end
Version data entries
15 entries across 15 versions & 1 rubygems