Class: FeedBooks::Type

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

Overview

Type object see feedbooks.com/api/types

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(name = nil) ⇒ Type

Returns a new instance of Type.



437
438
439
# File 'lib/ruby-feedbooks.rb', line 437

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

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



434
435
436
# File 'lib/ruby-feedbooks.rb', line 434

def name
  @name
end

#total_booksObject (readonly)

Returns the value of attribute total_books.



435
436
437
# File 'lib/ruby-feedbooks.rb', line 435

def total_books
  @total_books
end

Class Method Details

.all(lim = nil) ⇒ Object

List all types known on feedbooks



447
448
449
# File 'lib/ruby-feedbooks.rb', line 447

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

Instance Method Details

#books(limit = nil) ⇒ Object

all books tagged with this type



452
453
454
455
# File 'lib/ruby-feedbooks.rb', line 452

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

#recent_books(limit = nil) ⇒ Object

recent books tagged with this type



463
464
465
# File 'lib/ruby-feedbooks.rb', line 463

def recent_books(limit=nil)
	FeedBooks::Book.send('generic_iterate',"/type/#{@name}/books/recent.xml",limit)
end

#top_books(limit = nil) ⇒ Object

top books tagged with this type



458
459
460
# File 'lib/ruby-feedbooks.rb', line 458

def top_books(limit=nil)
	FeedBooks::Book.send('generic_iterate',"/type/#{@name}/books/top.xml",limit)
end