Class: FeedBooks::FBobject

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

Overview

Parent class for all API objects

Direct Known Subclasses

Author, Book, List, Type

Constant Summary collapse

@@connection =
Connection.new

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.connectionObject

connection getter should be a Connection



99
100
101
# File 'lib/ruby-feedbooks.rb', line 99

def self.connection
  @@connection
end

.connection=(con) ⇒ Object

connection setter



92
93
94
95
# File 'lib/ruby-feedbooks.rb', line 92

def self.connection=(con)
  @@connection=con
  @@connection=Connection.new if @@connection.nil?
end

.from_xml(txt) ⇒ Object

:nodoc:



114
115
116
117
118
# File 'lib/ruby-feedbooks.rb', line 114

def self.from_xml(txt) #:nodoc:
  doc=Hpricot.XML(txt)
  book=doc/"/*"
  return from_xml_elm(book)
end

Instance Method Details

#connectionObject

connection getter



110
111
112
# File 'lib/ruby-feedbooks.rb', line 110

def connection
  @@connection
end

#connection=(con) ⇒ Object

connection setter



104
105
106
107
# File 'lib/ruby-feedbooks.rb', line 104

def connection=(con)
  @@connection=con
  @@connection=Connection.new if @@connection.nil?
end