class GooglePlus::Cursor
Attributes
collection[R]
Public Class Methods
new(attrs, method, klass=nil)
click to toggle source
Initializes a new Cursor
object
@param attrs [Hash] @params method [String, Symbol] The name of the method to return the collection @params klass [Class] The class to instantiate object in the collection @return [GooglePlus::Cursor]
Calls superclass method
GooglePlus::Base::new
# File lib/google_plus/cursor.rb, line 17 def initialize(attrs, method, klass=nil) super(attrs) @collection = Array(attrs[method.to_s]).map do |item| if klass klass.new(item) else item end end singleton_class.class_eval do alias_method method.to_sym, :collection end end
Public Instance Methods
first?()
click to toggle source
@return [Boolean]
# File lib/google_plus/cursor.rb, line 32 def first? previous_cursor.zero? end
Also aliased as: first
last?()
click to toggle source
@return [Boolean]
# File lib/google_plus/cursor.rb, line 38 def last? next_cursor.zero? end
Also aliased as: last