Class: Nlg::Extractors::BookExtractor

Inherits:
Base
  • Object
show all
Defined in:
lib/bookshark/extractors/nlg/book_extractor.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#nlg_id, #page, #url

Instance Method Summary collapse

Methods inherited from Base

decode_text, #decode_text, #load_page, #load_page_by_id, #present?

Constructor Details

#initialize(id = nil) ⇒ BookExtractor

Returns a new instance of BookExtractor.



12
13
14
15
# File 'lib/bookshark/extractors/nlg/book_extractor.rb', line 12

def initialize(id=nil)
  super(id)
  extract_book unless id.nil? or @page.nil?
end

Instance Attribute Details

#bookObject (readonly)

Returns the value of attribute book.



10
11
12
# File 'lib/bookshark/extractors/nlg/book_extractor.rb', line 10

def book
  @book
end

Instance Method Details

#extract_book(nlg_id = @nlg_id, book_page = @page) ⇒ Object



22
23
24
# File 'lib/bookshark/extractors/nlg/book_extractor.rb', line 22

def extract_book(nlg_id=@nlg_id, book_page=@page)
  puts "should extract book #{nlg_id} from nlg"
end

#load_and_extract_book(id = nil) ⇒ Object



17
18
19
20
# File 'lib/bookshark/extractors/nlg/book_extractor.rb', line 17

def load_and_extract_book(id=nil)
  load_page(id)
  extract_book unless id.nil? or @page.nil?
end