kosher 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/kosher.gemspec +1 -1
- data/lib/kosher/author.rb +8 -0
- data/lib/kosher/book.rb +27 -5
- data/lib/kosher/image.rb +9 -0
- data/lib/kosher/version.rb +1 -1
- data/lib/kosher.rb +2 -0
- metadata +7 -5
data/kosher.gemspec
CHANGED
data/lib/kosher/book.rb
CHANGED
@@ -2,16 +2,38 @@ module Kosher
|
|
2
2
|
|
3
3
|
# A book.
|
4
4
|
#
|
5
|
-
# A book is
|
5
|
+
# A book is sold on many venues and has many offers through those venues.
|
6
6
|
class Book < Structure
|
7
|
-
key
|
8
|
-
key
|
9
|
-
key
|
7
|
+
key :asin
|
8
|
+
key :edition
|
9
|
+
key :format
|
10
|
+
key :images, :type => Hash
|
11
|
+
key :isbn
|
12
|
+
key :pages, :type => Integer
|
13
|
+
key :published_in, :type => Integer
|
14
|
+
key :publisher
|
15
|
+
key :title
|
16
|
+
key :volumes, :type => Integer
|
17
|
+
has_many :alternate_versions
|
18
|
+
has_many :authors
|
19
|
+
has_many :offers
|
20
|
+
has_many :related_items
|
10
21
|
|
11
|
-
#
|
22
|
+
# The best kosher offer.
|
23
|
+
#
|
24
|
+
# Returns nil if there are no (kosher) offers.
|
12
25
|
def best_kosher_offer
|
13
26
|
offer = offers.sort.first
|
14
27
|
offer && offer.kosher? ? offer : nil
|
15
28
|
end
|
29
|
+
|
30
|
+
# A full bibliographic description of the book, as in:
|
31
|
+
#
|
32
|
+
# Chronicle Books, 1991. Hardcover. 1st edition. 2 volumes. 1200 pages.
|
33
|
+
#
|
34
|
+
# Missing attributes are omitted.
|
35
|
+
def description
|
36
|
+
# TODO
|
37
|
+
end
|
16
38
|
end
|
17
39
|
end
|
data/lib/kosher/image.rb
ADDED
data/lib/kosher/version.rb
CHANGED
data/lib/kosher.rb
CHANGED
@@ -9,10 +9,12 @@ require 'structure/json'
|
|
9
9
|
require 'kosher/threshold'
|
10
10
|
|
11
11
|
# Require the models.
|
12
|
+
require 'kosher/author'
|
12
13
|
require 'kosher/availability'
|
13
14
|
require 'kosher/book'
|
14
15
|
require 'kosher/condition'
|
15
16
|
require 'kosher/description'
|
17
|
+
require 'kosher/image'
|
16
18
|
require 'kosher/item'
|
17
19
|
require 'kosher/location'
|
18
20
|
require 'kosher/offer'
|
metadata
CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 0
|
7
|
-
-
|
7
|
+
- 4
|
8
8
|
- 0
|
9
|
-
version: 0.
|
9
|
+
version: 0.4.0
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Paper Cavalier
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2011-
|
17
|
+
date: 2011-06-01 00:00:00 +01:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -72,9 +72,9 @@ dependencies:
|
|
72
72
|
- !ruby/object:Gem::Version
|
73
73
|
segments:
|
74
74
|
- 0
|
75
|
-
-
|
75
|
+
- 7
|
76
76
|
- 0
|
77
|
-
version: 0.
|
77
|
+
version: 0.7.0
|
78
78
|
type: :runtime
|
79
79
|
version_requirements: *id004
|
80
80
|
description: Kosher is a somewhat overengineered attempt to abstract bookselling into a set of models.
|
@@ -93,10 +93,12 @@ files:
|
|
93
93
|
- Rakefile
|
94
94
|
- kosher.gemspec
|
95
95
|
- lib/kosher.rb
|
96
|
+
- lib/kosher/author.rb
|
96
97
|
- lib/kosher/availability.rb
|
97
98
|
- lib/kosher/book.rb
|
98
99
|
- lib/kosher/condition.rb
|
99
100
|
- lib/kosher/description.rb
|
101
|
+
- lib/kosher/image.rb
|
100
102
|
- lib/kosher/item.rb
|
101
103
|
- lib/kosher/location.rb
|
102
104
|
- lib/kosher/offer.rb
|