Class: CONTENTdmAPI::Request
- Inherits:
-
Object
- Object
- CONTENTdmAPI::Request
- Defined in:
- lib/contentdm_api/request.rb
Overview
Form requests to the ContentDM API
Instance Attribute Summary collapse
-
#base_url ⇒ Object
readonly
Returns the value of attribute base_url.
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#service ⇒ Object
readonly
Returns the value of attribute service.
Instance Method Summary collapse
-
#fetch ⇒ String
Fetch data from the CONTENTdm API.
- #initialize(base_url: '', client: Net::HTTP, service: Service.new) ⇒ Void constructor
- #uri ⇒ Object
Constructor Details
Instance Attribute Details
#base_url ⇒ Object (readonly)
Returns the value of attribute base_url.
5 6 7 |
# File 'lib/contentdm_api/request.rb', line 5 def base_url @base_url end |
#client ⇒ Object (readonly)
Returns the value of attribute client.
5 6 7 |
# File 'lib/contentdm_api/request.rb', line 5 def client @client end |
#service ⇒ Object (readonly)
Returns the value of attribute service.
5 6 7 |
# File 'lib/contentdm_api/request.rb', line 5 def service @service end |
Instance Method Details
#fetch ⇒ String
Fetch data from the CONTENTdm API
22 23 24 |
# File 'lib/contentdm_api/request.rb', line 22 def fetch request.body end |
#uri ⇒ Object
26 27 28 |
# File 'lib/contentdm_api/request.rb', line 26 def uri @uri = URI.parse(unencoded_url) end |