Class: RBook::GBIP::Title

Inherits:
Object
  • Object
show all
Defined in:
lib/rbook/gbip/title.rb

Overview

models a warehouse supply detail from the Global Books in Print API

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(arr) ⇒ Title

Returns a new instance of Title.

Raises:

  • (ArgumentError)


15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/rbook/gbip/title.rb', line 15

def initialize(arr)
  raise ArgumentError, "arr must be an array" unless arr.class == Array
  #raise ArgumentError, "Invalid number of array elements" unless arr.size == 14

  self.market = arr[2].strip
  self.title = arr[3].strip
  self.isbn = RBook::ISBN.convert_to_isbn13(arr[4].strip) || arr[4].strip
  self.binding = arr[5].strip
  self.status = arr[6].strip
  self.edition = arr[7].strip
  self.contributor = arr[8].strip
  self.publisher = arr[9].strip
  self.publication_date = arr[10].strip
  self.rrp = BigDecimal.new(arr[11].strip)
  self.supplier = arr[12].strip
  self.suppliers_with_stock = arr[13].strip

  @warehouses = []
end

Instance Attribute Details

#bindingObject

Returns the value of attribute binding.



10
11
12
# File 'lib/rbook/gbip/title.rb', line 10

def binding
  @binding
end

#contributorObject

Returns the value of attribute contributor.



11
12
13
# File 'lib/rbook/gbip/title.rb', line 11

def contributor
  @contributor
end

#editionObject

Returns the value of attribute edition.



10
11
12
# File 'lib/rbook/gbip/title.rb', line 10

def edition
  @edition
end

#isbnObject

Returns the value of attribute isbn.



10
11
12
# File 'lib/rbook/gbip/title.rb', line 10

def isbn
  @isbn
end

#marketObject

Returns the value of attribute market.



10
11
12
# File 'lib/rbook/gbip/title.rb', line 10

def market
  @market
end

#publication_dateObject

Returns the value of attribute publication_date.



11
12
13
# File 'lib/rbook/gbip/title.rb', line 11

def publication_date
  @publication_date
end

#publisherObject

Returns the value of attribute publisher.



11
12
13
# File 'lib/rbook/gbip/title.rb', line 11

def publisher
  @publisher
end

#rrpObject

Returns the value of attribute rrp.



12
13
14
# File 'lib/rbook/gbip/title.rb', line 12

def rrp
  @rrp
end

#statusObject

Returns the value of attribute status.



10
11
12
# File 'lib/rbook/gbip/title.rb', line 10

def status
  @status
end

#supplierObject

Returns the value of attribute supplier.



12
13
14
# File 'lib/rbook/gbip/title.rb', line 12

def supplier
  @supplier
end

#suppliers_with_stockObject

Returns the value of attribute suppliers_with_stock.



12
13
14
# File 'lib/rbook/gbip/title.rb', line 12

def suppliers_with_stock
  @suppliers_with_stock
end

#titleObject

Returns the value of attribute title.



10
11
12
# File 'lib/rbook/gbip/title.rb', line 10

def title
  @title
end

#warehousesObject

Returns the value of attribute warehouses.



13
14
15
# File 'lib/rbook/gbip/title.rb', line 13

def warehouses
  @warehouses
end