Class: Arclight::Requests::GoogleForm
- Inherits:
-
Object
- Object
- Arclight::Requests::GoogleForm
- Defined in:
- app/models/arclight/requests/google_form.rb
Overview
This object relies on the ability to respond to attributes passed in as query parameters from the form mapping configuratino
Instance Attribute Summary collapse
-
#document ⇒ Object
readonly
Returns the value of attribute document.
-
#document_url ⇒ Object
readonly
Returns the value of attribute document_url.
-
#presenter ⇒ Object
readonly
Returns the value of attribute presenter.
Instance Method Summary collapse
-
#form_mapping ⇒ Hash
Converts mappings as a query url param into a Hash used for sending messages and providing pre-filled form fields “collection_name=entry.123” => { “collection_name” => “entry.123” }.
-
#initialize(document, presenter, document_url) ⇒ GoogleForm
constructor
A new instance of GoogleForm.
- #title ⇒ Object
-
#url ⇒ Object
Url of form to fill.
Constructor Details
#initialize(document, presenter, document_url) ⇒ GoogleForm
Returns a new instance of GoogleForm.
16 17 18 19 20 |
# File 'app/models/arclight/requests/google_form.rb', line 16 def initialize(document, presenter, document_url) @document = document @presenter = presenter @document_url = document_url end |
Instance Attribute Details
#document ⇒ Object (readonly)
Returns the value of attribute document.
9 10 11 |
# File 'app/models/arclight/requests/google_form.rb', line 9 def document @document end |
#document_url ⇒ Object (readonly)
Returns the value of attribute document_url.
9 10 11 |
# File 'app/models/arclight/requests/google_form.rb', line 9 def document_url @document_url end |
#presenter ⇒ Object (readonly)
Returns the value of attribute presenter.
9 10 11 |
# File 'app/models/arclight/requests/google_form.rb', line 9 def presenter @presenter end |
Instance Method Details
#form_mapping ⇒ Hash
Converts mappings as a query url param into a Hash used for sending messages and providing pre-filled form fields “collection_name=entry.123” => { “collection_name” => “entry.123” }
33 34 35 36 37 |
# File 'app/models/arclight/requests/google_form.rb', line 33 def form_mapping Rack::Utils.parse_nested_query( document.repository_config&.request_mappings_for_type('google_form') ) end |
#title ⇒ Object
39 40 41 |
# File 'app/models/arclight/requests/google_form.rb', line 39 def title presenter.heading end |
#url ⇒ Object
Url of form to fill
24 25 26 |
# File 'app/models/arclight/requests/google_form.rb', line 24 def url document.repository_config&.request_url_for_type('google_form') end |