Class: CDMBL::OaiRequest
- Inherits:
-
Object
- Object
- CDMBL::OaiRequest
- Defined in:
- lib/cdmbl/oai_request.rb
Instance Attribute Summary collapse
-
#base_uri ⇒ Object
readonly
Returns the value of attribute base_uri.
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#from ⇒ Object
readonly
Returns the value of attribute from.
-
#identifier ⇒ Object
readonly
Returns the value of attribute identifier.
-
#resumption_token ⇒ Object
readonly
Returns the value of attribute resumption_token.
-
#set ⇒ Object
readonly
Returns the value of attribute set.
Instance Method Summary collapse
- #identifiers ⇒ Object
-
#initialize(base_uri: '', resumption_token: nil, set: nil, identifier: '', from: nil, client: Net::HTTP) ⇒ OaiRequest
constructor
A new instance of OaiRequest.
- #sets ⇒ Object
Constructor Details
#initialize(base_uri: '', resumption_token: nil, set: nil, identifier: '', from: nil, client: Net::HTTP) ⇒ OaiRequest
Returns a new instance of OaiRequest.
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/cdmbl/oai_request.rb', line 10 def initialize(base_uri: '', resumption_token: nil, set: nil, identifier: '', from: nil, client: Net::HTTP) @base_uri = base_uri @resumption_token = resumption_token @client = client @set = (set) ? "&set=#{set}" : '' @from = from ? "&from=#{from}" : '' @identifier = identifier end |
Instance Attribute Details
#base_uri ⇒ Object (readonly)
Returns the value of attribute base_uri.
4 5 6 |
# File 'lib/cdmbl/oai_request.rb', line 4 def base_uri @base_uri end |
#client ⇒ Object (readonly)
Returns the value of attribute client.
4 5 6 |
# File 'lib/cdmbl/oai_request.rb', line 4 def client @client end |
#from ⇒ Object (readonly)
Returns the value of attribute from.
4 5 6 |
# File 'lib/cdmbl/oai_request.rb', line 4 def from @from end |
#identifier ⇒ Object (readonly)
Returns the value of attribute identifier.
4 5 6 |
# File 'lib/cdmbl/oai_request.rb', line 4 def identifier @identifier end |
#resumption_token ⇒ Object (readonly)
Returns the value of attribute resumption_token.
4 5 6 |
# File 'lib/cdmbl/oai_request.rb', line 4 def resumption_token @resumption_token end |
#set ⇒ Object (readonly)
Returns the value of attribute set.
4 5 6 |
# File 'lib/cdmbl/oai_request.rb', line 4 def set @set end |
Instance Method Details
#identifiers ⇒ Object
24 25 26 |
# File 'lib/cdmbl/oai_request.rb', line 24 def identifiers @ids ||= (resumption_token) ? request(batch_uri) : request(first_batch_uri) end |
#sets ⇒ Object
28 29 30 |
# File 'lib/cdmbl/oai_request.rb', line 28 def sets @sets ||= request(sets_uri) end |