Class: ARBookFinder::Book

Inherits:
Object
  • Object
show all
Defined in:
lib/ar_book_finder/book.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url) ⇒ Book

Returns a new instance of Book.



11
12
13
14
# File 'lib/ar_book_finder/book.rb', line 11

def initialize(url)
  @url = url
  @publishers = []
end

Instance Attribute Details

#ar_pointsObject (readonly)

Returns the value of attribute ar_points.



5
6
7
# File 'lib/ar_book_finder/book.rb', line 5

def ar_points
  @ar_points
end

#ar_quiz_availabilityObject (readonly)

Returns the value of attribute ar_quiz_availability.



5
6
7
# File 'lib/ar_book_finder/book.rb', line 5

def ar_quiz_availability
  @ar_quiz_availability
end

#ar_quiz_numberObject (readonly)

Returns the value of attribute ar_quiz_number.



5
6
7
# File 'lib/ar_book_finder/book.rb', line 5

def ar_quiz_number
  @ar_quiz_number
end

#atos_book_levelObject (readonly)

Returns the value of attribute atos_book_level.



5
6
7
# File 'lib/ar_book_finder/book.rb', line 5

def atos_book_level
  @atos_book_level
end

#authorObject (readonly)

Returns the value of attribute author.



5
6
7
# File 'lib/ar_book_finder/book.rb', line 5

def author
  @author
end

#coverObject (readonly)

Returns the value of attribute cover.



5
6
7
# File 'lib/ar_book_finder/book.rb', line 5

def cover
  @cover
end

#interest_levelObject (readonly)

Returns the value of attribute interest_level.



5
6
7
# File 'lib/ar_book_finder/book.rb', line 5

def interest_level
  @interest_level
end

#languageObject (readonly)

Returns the value of attribute language.



5
6
7
# File 'lib/ar_book_finder/book.rb', line 5

def language
  @language
end

#publishersObject (readonly)

Returns the value of attribute publishers.



5
6
7
# File 'lib/ar_book_finder/book.rb', line 5

def publishers
  @publishers
end

#ratingObject (readonly)

Returns the value of attribute rating.



5
6
7
# File 'lib/ar_book_finder/book.rb', line 5

def rating
  @rating
end

#seriesObject (readonly)

Returns the value of attribute series.



5
6
7
# File 'lib/ar_book_finder/book.rb', line 5

def series
  @series
end

#summaryObject (readonly)

Returns the value of attribute summary.



5
6
7
# File 'lib/ar_book_finder/book.rb', line 5

def summary
  @summary
end

#titleObject (readonly)

Returns the value of attribute title.



5
6
7
# File 'lib/ar_book_finder/book.rb', line 5

def title
  @title
end

#topicsObject (readonly)

Returns the value of attribute topics.



5
6
7
# File 'lib/ar_book_finder/book.rb', line 5

def topics
  @topics
end

#typeObject (readonly)

Returns the value of attribute type.



5
6
7
# File 'lib/ar_book_finder/book.rb', line 5

def type
  @type
end

#urlObject (readonly)

Returns the value of attribute url.



5
6
7
# File 'lib/ar_book_finder/book.rb', line 5

def url
  @url
end

#word_countObject (readonly)

Returns the value of attribute word_count.



5
6
7
# File 'lib/ar_book_finder/book.rb', line 5

def word_count
  @word_count
end

Instance Method Details

#fetchObject



16
17
18
19
20
# File 'lib/ar_book_finder/book.rb', line 16

def fetch
  BookDetailProcessor.new(@url).process
  load(BookDetailParser.new(Capybara.page.html).parse)
  self
end