alma 0.2.8 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.ruby-version +1 -1
- data/.travis.yml +10 -2
- data/Guardfile +75 -0
- data/README.md +136 -26
- data/alma.gemspec +9 -4
- data/lib/alma.rb +8 -4
- data/lib/alma/api_defaults.rb +30 -0
- data/lib/alma/availability_response.rb +1 -1
- data/lib/alma/bib.rb +4 -22
- data/lib/alma/bib_item.rb +8 -31
- data/lib/alma/bib_item_set.rb +60 -11
- data/lib/alma/bib_set.rb +7 -21
- data/lib/alma/config.rb +7 -3
- data/lib/alma/electronic.rb +167 -0
- data/lib/alma/electronic/README.md +20 -0
- data/lib/alma/electronic/batch_utils.rb +224 -0
- data/lib/alma/electronic/business.rb +29 -0
- data/lib/alma/error.rb +12 -1
- data/lib/alma/fine.rb +15 -0
- data/lib/alma/fine_set.rb +34 -23
- data/lib/alma/item_request_options.rb +22 -0
- data/lib/alma/loan.rb +18 -0
- data/lib/alma/loan_set.rb +59 -17
- data/lib/alma/renewal_response.rb +7 -3
- data/lib/alma/request.rb +165 -0
- data/lib/alma/request_options.rb +31 -18
- data/lib/alma/request_set.rb +62 -17
- data/lib/alma/response.rb +45 -0
- data/lib/alma/result_set.rb +27 -35
- data/lib/alma/user.rb +65 -57
- data/lib/alma/user_request.rb +17 -0
- data/lib/alma/user_set.rb +5 -6
- data/lib/alma/version.rb +1 -1
- data/log/.gitignore +4 -0
- metadata +75 -8
- data/lib/alma/api.rb +0 -33
data/lib/alma/api.rb
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
require 'ezwadl'
|
2
|
-
|
3
|
-
module Alma
|
4
|
-
module Api
|
5
|
-
|
6
|
-
|
7
|
-
def default_params
|
8
|
-
{ :query => { :apikey => Alma.configuration.apikey } }
|
9
|
-
end
|
10
|
-
|
11
|
-
def query_merge(hash)
|
12
|
-
{:query => default_params[:query].merge(hash)}
|
13
|
-
end
|
14
|
-
|
15
|
-
def resources
|
16
|
-
@resources ||= load_wadl
|
17
|
-
end
|
18
|
-
|
19
|
-
def load_wadl(wadl_filename = nil)
|
20
|
-
wadl_filename ||= set_wadl_filename
|
21
|
-
parsed_wadl = EzWadl::Parser.parse(File.join(Alma::WADL_DIR, wadl_filename)) do |rs|
|
22
|
-
rs.first.path = Alma.configuration.region
|
23
|
-
end
|
24
|
-
parsed_wadl.first
|
25
|
-
end
|
26
|
-
|
27
|
-
def set_wadl_filename
|
28
|
-
# Each class including this module should define this
|
29
|
-
raise NotImplementedError 'You must define the wadl_filename method'
|
30
|
-
end
|
31
|
-
|
32
|
-
end
|
33
|
-
end
|