Class: FeedBooks::List
- 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
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Class Method Summary collapse
-
.all(lim = nil) ⇒ Object
All list on feedbooks.
Instance Method Summary collapse
-
#books(limit = nil) ⇒ Object
All books in the list.
- #description ⇒ Object
-
#each_books(lim = nil) ⇒ Object
(also: #each)
iterate through books in the list.
- #favorites ⇒ Object
- #identifier ⇒ Object
-
#initialize(id = nil) ⇒ List
constructor
A new instance of List.
- #items ⇒ Object
- #title ⇒ Object
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
#id ⇒ Object (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 |
#description ⇒ Object
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 |
#favorites ⇒ Object
519 520 521 522 |
# File 'lib/ruby-feedbooks.rb', line 519 def favorites get_attr if @title==nil @favorites.to_i end |
#identifier ⇒ Object
509 510 511 512 |
# File 'lib/ruby-feedbooks.rb', line 509 def identifier get_attr if @title==nil @identifier end |
#items ⇒ Object
524 525 526 527 |
# File 'lib/ruby-feedbooks.rb', line 524 def items get_attr if @title==nil @items.to_i end |
#title ⇒ Object
504 505 506 507 |
# File 'lib/ruby-feedbooks.rb', line 504 def title get_attr if @title==nil @title end |