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.
- #request_config ⇒ Object
- #title ⇒ Object
-
#url ⇒ Object
Url of form to fill.
Constructor Details
#initialize(document, presenter, document_url) ⇒ GoogleForm
Returns a new instance of GoogleForm.
17 18 19 20 21 |
# File 'app/models/arclight/requests/google_form.rb', line 17 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” }
34 35 36 37 38 |
# File 'app/models/arclight/requests/google_form.rb', line 34 def form_mapping Rack::Utils.parse_nested_query( request_config['request_mappings'] ) end |
#request_config ⇒ Object
44 45 46 |
# File 'app/models/arclight/requests/google_form.rb', line 44 def request_config document.repository_config&.request_config_for_type('google_form') end |
#title ⇒ Object
40 41 42 |
# File 'app/models/arclight/requests/google_form.rb', line 40 def title presenter.heading end |
#url ⇒ Object
Url of form to fill
25 26 27 |
# File 'app/models/arclight/requests/google_form.rb', line 25 def url request_config['request_url'] end |