Class: RBook::GBIP::Title
- Inherits:
-
Object
- Object
- RBook::GBIP::Title
- Defined in:
- lib/rbook/gbip/title.rb
Overview
models a warehouse supply detail from the Global Books in Print API
Instance Attribute Summary collapse
-
#binding ⇒ Object
Returns the value of attribute binding.
-
#contributor ⇒ Object
Returns the value of attribute contributor.
-
#edition ⇒ Object
Returns the value of attribute edition.
-
#isbn ⇒ Object
Returns the value of attribute isbn.
-
#market ⇒ Object
Returns the value of attribute market.
-
#publication_date ⇒ Object
Returns the value of attribute publication_date.
-
#publisher ⇒ Object
Returns the value of attribute publisher.
-
#rrp ⇒ Object
Returns the value of attribute rrp.
-
#status ⇒ Object
Returns the value of attribute status.
-
#supplier ⇒ Object
Returns the value of attribute supplier.
-
#suppliers_with_stock ⇒ Object
Returns the value of attribute suppliers_with_stock.
-
#title ⇒ Object
Returns the value of attribute title.
-
#warehouses ⇒ Object
Returns the value of attribute warehouses.
Instance Method Summary collapse
-
#initialize(arr) ⇒ Title
constructor
A new instance of Title.
Constructor Details
#initialize(arr) ⇒ Title
Returns a new instance of Title.
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
#binding ⇒ Object
Returns the value of attribute binding.
10 11 12 |
# File 'lib/rbook/gbip/title.rb', line 10 def binding @binding end |
#contributor ⇒ Object
Returns the value of attribute contributor.
11 12 13 |
# File 'lib/rbook/gbip/title.rb', line 11 def contributor @contributor end |
#edition ⇒ Object
Returns the value of attribute edition.
10 11 12 |
# File 'lib/rbook/gbip/title.rb', line 10 def edition @edition end |
#isbn ⇒ Object
Returns the value of attribute isbn.
10 11 12 |
# File 'lib/rbook/gbip/title.rb', line 10 def isbn @isbn end |
#market ⇒ Object
Returns the value of attribute market.
10 11 12 |
# File 'lib/rbook/gbip/title.rb', line 10 def market @market end |
#publication_date ⇒ Object
Returns the value of attribute publication_date.
11 12 13 |
# File 'lib/rbook/gbip/title.rb', line 11 def publication_date @publication_date end |
#publisher ⇒ Object
Returns the value of attribute publisher.
11 12 13 |
# File 'lib/rbook/gbip/title.rb', line 11 def publisher @publisher end |
#rrp ⇒ Object
Returns the value of attribute rrp.
12 13 14 |
# File 'lib/rbook/gbip/title.rb', line 12 def rrp @rrp end |
#status ⇒ Object
Returns the value of attribute status.
10 11 12 |
# File 'lib/rbook/gbip/title.rb', line 10 def status @status end |
#supplier ⇒ Object
Returns the value of attribute supplier.
12 13 14 |
# File 'lib/rbook/gbip/title.rb', line 12 def supplier @supplier end |
#suppliers_with_stock ⇒ Object
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 |
#title ⇒ Object
Returns the value of attribute title.
10 11 12 |
# File 'lib/rbook/gbip/title.rb', line 10 def title @title end |
#warehouses ⇒ Object
Returns the value of attribute warehouses.
13 14 15 |
# File 'lib/rbook/gbip/title.rb', line 13 def warehouses @warehouses end |