Class: Arclight::Requests::AeonWebEad
- Inherits:
-
Object
- Object
- Arclight::Requests::AeonWebEad
- Defined in:
- app/models/arclight/requests/aeon_web_ead.rb
Overview
This object relies on the ability to respond to attributes passed in as query parameters from the form mapping configuration
Instance Attribute Summary collapse
-
#document ⇒ Object
readonly
Returns the value of attribute document.
-
#ead_url ⇒ Object
readonly
Returns the value of attribute ead_url.
Instance Method Summary collapse
-
#form_mapping ⇒ Hash
Converts mappings as a query url param into a Hash used for sending messages If a defined method is provided as a value, that method will be invoked “collection_name=entry.123” => { “collection_name” => “entry.123” }.
-
#initialize(document, ead_url) ⇒ AeonWebEad
constructor
A new instance of AeonWebEad.
-
#request_url ⇒ Object
Url target for Aeon request params.
-
#url ⇒ Object
Constructed request URL.
Constructor Details
#initialize(document, ead_url) ⇒ AeonWebEad
Returns a new instance of AeonWebEad.
13 14 15 16 |
# File 'app/models/arclight/requests/aeon_web_ead.rb', line 13 def initialize(document, ead_url) @document = document @ead_url = ead_url end |
Instance Attribute Details
#document ⇒ Object (readonly)
Returns the value of attribute document.
9 10 11 |
# File 'app/models/arclight/requests/aeon_web_ead.rb', line 9 def document @document end |
#ead_url ⇒ Object (readonly)
Returns the value of attribute ead_url.
9 10 11 |
# File 'app/models/arclight/requests/aeon_web_ead.rb', line 9 def ead_url @ead_url end |
Instance Method Details
#form_mapping ⇒ Hash
Converts mappings as a query url param into a Hash used for sending messages If a defined method is provided as a value, that method will be invoked “collection_name=entry.123” => { “collection_name” => “entry.123” }
36 37 38 39 40 41 42 43 44 |
# File 'app/models/arclight/requests/aeon_web_ead.rb', line 36 def form_mapping form_hash = Rack::Utils.parse_nested_query( document.repository_config.request_mappings_for_type('aeon_web_ead') ) form_hash.each do |key, value| respond_to?(value) && form_hash[key] = send(value) end form_hash end |
#request_url ⇒ Object
Url target for Aeon request params
20 21 22 |
# File 'app/models/arclight/requests/aeon_web_ead.rb', line 20 def request_url document.repository_config.request_url_for_type('aeon_web_ead') end |
#url ⇒ Object
Constructed request URL
26 27 28 |
# File 'app/models/arclight/requests/aeon_web_ead.rb', line 26 def url "#{request_url}?#{form_mapping.to_query}" end |