Sha256: d52c99d1cd1d7697882fe780ae7e8f471f7a1234d262708ec97dfe1adb0612bd
Contents?: true
Size: 1.16 KB
Versions: 52
Compression:
Stored size: 1.16 KB
Contents
module FbGraph class Connection < Collection attr_accessor :collection, :connection, :owner, :options delegate :total_count, :unread_count, :updated_time, :to => :collection def initialize(owner, connection, options = {}) @owner = owner @options = options @connection = connection @collection = options.delete(:collection) || Collection.new replace collection end def next(_options_ = {}) if self.collection.next.present? connection_method = if self.owner.respond_to?(self.connection) self.connection else self.owner.public_methods.detect do |method| method.to_s.gsub('_', '') == self.connection.to_s end end self.owner.send(connection_method, self.options.merge(_options_).merge(self.collection.next)) else self.class.new(self.owner, self.connection) end end def previous(_options_ = {}) if self.collection.previous.present? self.owner.send(self.connection, self.options.merge(_options_).merge(self.collection.previous)) else self.class.new(self.owner, self.connection) end end end end
Version data entries
52 entries across 52 versions & 1 rubygems