Class: FeedBooks::List

Inherits:
FBobject show all
Includes:
Enumerable
Defined in:
lib/ruby-feedbooks.rb

Overview

List object see feedbooks.com/api/lists. A list is a collection of Book

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from FBobject

#connection, connection, connection=, #connection=, from_xml

Constructor Details

#initialize(id = nil) ⇒ List

Returns a new instance of List.



500
501
502
# File 'lib/ruby-feedbooks.rb', line 500

def initialize(id=nil)
	@id=id
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



499
500
501
# File 'lib/ruby-feedbooks.rb', line 499

def id
  @id
end

Class Method Details

.all(lim = nil) ⇒ Object

All list on feedbooks



535
536
537
# File 'lib/ruby-feedbooks.rb', line 535

def self.all(lim=nil)
	generic_iterate('/lists.xml',lim)
end

Instance Method Details

#books(limit = nil) ⇒ Object

All books in the list



530
531
532
# File 'lib/ruby-feedbooks.rb', line 530

def books(limit=nil)
	FeedBooks::Book.send('generic_iterate',"/list/#{@id}.xml",limit)
end

#descriptionObject



514
515
516
517
# File 'lib/ruby-feedbooks.rb', line 514

def description
	get_attr if @title==nil	
	@description
end

#each_books(lim = nil) ⇒ Object Also known as: each

iterate through books in the list



540
541
542
# File 'lib/ruby-feedbooks.rb', line 540

def each_books(lim=nil)
	books.each{|b| yield b}
end

#favoritesObject



519
520
521
522
# File 'lib/ruby-feedbooks.rb', line 519

def favorites
	get_attr if @title==nil	
	@favorites.to_i
end

#identifierObject



509
510
511
512
# File 'lib/ruby-feedbooks.rb', line 509

def identifier
	get_attr if @title==nil	
	@identifier
end

#itemsObject



524
525
526
527
# File 'lib/ruby-feedbooks.rb', line 524

def items
	get_attr if @title==nil	
	@items.to_i
end

#titleObject



504
505
506
507
# File 'lib/ruby-feedbooks.rb', line 504

def title
	get_attr if @title==nil	
	@title
end