Class: Alexandrite::Book

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

Overview

Create a book objects

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(volume_info) ⇒ Alexandrite::Books

Parameters:

  • volume_info (Hash)


13
14
15
16
17
18
# File 'lib/alexandrite_books.rb', line 13

def initialize(volume_info)
  add_origin(volume_info)
  add_basic_values(volume_info)
  add_industry_identifiers(volume_info, @origin)
  @error_message = volume_info[:error_message]
end

Instance Attribute Details

#authorsObject

Returns the value of attribute authors.



8
9
10
# File 'lib/alexandrite_books.rb', line 8

def authors
  @authors
end

#categoriesObject

Returns the value of attribute categories.



8
9
10
# File 'lib/alexandrite_books.rb', line 8

def categories
  @categories
end

#countryObject

Returns the value of attribute country.



8
9
10
# File 'lib/alexandrite_books.rb', line 8

def country
  @country
end

#ddcObject

Returns the value of attribute ddc.



8
9
10
# File 'lib/alexandrite_books.rb', line 8

def ddc
  @ddc
end

#descriptionObject

Returns the value of attribute description.



8
9
10
# File 'lib/alexandrite_books.rb', line 8

def description
  @description
end

#error_messageObject

Returns the value of attribute error_message.



8
9
10
# File 'lib/alexandrite_books.rb', line 8

def error_message
  @error_message
end

#isbn10Object

Returns the value of attribute isbn10.



8
9
10
# File 'lib/alexandrite_books.rb', line 8

def isbn10
  @isbn10
end

#isbn13Object

Returns the value of attribute isbn13.



8
9
10
# File 'lib/alexandrite_books.rb', line 8

def isbn13
  @isbn13
end

#languageObject

Returns the value of attribute language.



8
9
10
# File 'lib/alexandrite_books.rb', line 8

def language
  @language
end

#lccObject

Returns the value of attribute lcc.



8
9
10
# File 'lib/alexandrite_books.rb', line 8

def lcc
  @lcc
end

#page_countObject

Returns the value of attribute page_count.



8
9
10
# File 'lib/alexandrite_books.rb', line 8

def page_count
  @page_count
end

#published_dateObject

Returns the value of attribute published_date.



8
9
10
# File 'lib/alexandrite_books.rb', line 8

def published_date
  @published_date
end

#publisherObject

Returns the value of attribute publisher.



8
9
10
# File 'lib/alexandrite_books.rb', line 8

def publisher
  @publisher
end

#suggested_classificationsObject

Returns the value of attribute suggested_classifications.



8
9
10
# File 'lib/alexandrite_books.rb', line 8

def suggested_classifications
  @suggested_classifications
end

#titleObject

Returns the value of attribute title.



8
9
10
# File 'lib/alexandrite_books.rb', line 8

def title
  @title
end

Class Method Details

.add_to_collection(book) ⇒ Object



22
23
24
# File 'lib/alexandrite_books.rb', line 22

def self.add_to_collection(book)
  @@collection.push(book)
end

.collectionObject



20
# File 'lib/alexandrite_books.rb', line 20

def self.collection = @@collection

Instance Method Details

#add_classification_suggested(suggestions) ⇒ NilClass

Parameters:

  • suggestions (Array<String>)

Returns:

  • (NilClass)


36
# File 'lib/alexandrite_books.rb', line 36

def add_classification_suggested(suggestions) = @suggested_classifications = suggestions

#add_ddc(ddc_code) ⇒ NilClass

Parameters:

  • ddc_code (String)

Returns:

  • (NilClass)


28
# File 'lib/alexandrite_books.rb', line 28

def add_ddc(ddc_code) = @ddc = ddc_code

#add_lcc(lcc_code) ⇒ NilClass

Parameters:

  • lcc_code (String)

Returns:

  • (NilClass)


32
# File 'lib/alexandrite_books.rb', line 32

def add_lcc(lcc_code) = @lcc = lcc_code