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_config ⇒ Object
-
#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.
14 15 16 17 |
# File 'app/models/arclight/requests/aeon_web_ead.rb', line 14 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” }
37 38 39 40 41 42 43 44 45 |
# File 'app/models/arclight/requests/aeon_web_ead.rb', line 37 def form_mapping form_hash = Rack::Utils.parse_nested_query( request_config['request_mappings'] ) form_hash.each do |key, value| respond_to?(value) && form_hash[key] = send(value) end form_hash end |
#request_config ⇒ Object
47 48 49 |
# File 'app/models/arclight/requests/aeon_web_ead.rb', line 47 def request_config document.repository_config.request_config_for_type('aeon_web_ead') end |
#request_url ⇒ Object
Url target for Aeon request params
21 22 23 |
# File 'app/models/arclight/requests/aeon_web_ead.rb', line 21 def request_url request_config['request_url'] end |
#url ⇒ Object
Constructed request URL
27 28 29 |
# File 'app/models/arclight/requests/aeon_web_ead.rb', line 27 def url "#{request_url}?#{form_mapping.to_query}" end |