Class: HTML2FB::FBSession

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

Constant Summary collapse

@@fbsession =
nil

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(conf) ⇒ FBSession

Returns a new instance of FBSession.



15
16
17
18
19
20
21
22
23
24
# File 'lib/Html2Feedbooks/feedbooks.rb', line 15

def initialize(conf)
	StandardError.new('Already in session') unless @@fbsession.nil?
	@@fbsession=self
	self.bookid=ask(conf['fb']['bookid'],"Book Id")
	self.booktype=ask(conf['fb']['booktype'],"Book Type")
	self.user=ask(conf['fb']['user'],"User")
	self.pass=ask(conf['fb']['pass'],"Pass")
	self.host=conf['fb']['host']
	self.host='feedbooks.com' if @host.nil?
end

Instance Attribute Details

#bookidObject

Returns the value of attribute bookid.



9
10
11
# File 'lib/Html2Feedbooks/feedbooks.rb', line 9

def bookid
  @bookid
end

#booktypeObject

Returns the value of attribute booktype.



10
11
12
# File 'lib/Html2Feedbooks/feedbooks.rb', line 10

def booktype
  @booktype
end

#hostObject

Returns the value of attribute host.



13
14
15
# File 'lib/Html2Feedbooks/feedbooks.rb', line 13

def host
  @host
end

#passObject

Returns the value of attribute pass.



12
13
14
# File 'lib/Html2Feedbooks/feedbooks.rb', line 12

def pass
  @pass
end

#userObject

Returns the value of attribute user.



11
12
13
# File 'lib/Html2Feedbooks/feedbooks.rb', line 11

def user
  @user
end

Class Method Details

.sessionObject



26
27
28
# File 'lib/Html2Feedbooks/feedbooks.rb', line 26

def self.session
	return @@fbsession
end