Class: Glib::JsonUi::ActionBuilder::Action
- Inherits:
-
JsonUiElement
- Object
- JsonUiElement
- Glib::JsonUi::ActionBuilder::Action
- Defined in:
- app/helpers/glib/json_ui/action_builder.rb
Direct Known Subclasses
Glib::JsonUi::ActionBuilder::Auth::SaveCsrfToken, Data::Clear, Data::SaveCsrfToken, Dialogs::Alert, Dialogs::Close, Dialogs::Notification, Dialogs::Open, Dialogs::Options, Dialogs::Snackbar, Forms::Submit, Http::Delete, Http::Patch, Http::Post, Snackbars::Alert, Snackbars::Options, Windows::Close, Windows::CloseAll, Windows::Open, Windows::OpenWeb, Windows::Reload
Instance Attribute Summary
Attributes inherited from JsonUiElement
Instance Method Summary collapse
- #analytics(value) ⇒ Object
-
#created ⇒ Object
Override.
Methods inherited from JsonUiElement
Constructor Details
This class inherits a constructor from Glib::JsonUi::JsonUiElement
Instance Method Details
#analytics(value) ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'app/helpers/glib/json_ui/action_builder.rb', line 9 def analytics(value) if value.is_a?(String) @analyticsEnabled = true @analyticsId = value else @analyticsEnabled = value == true end end |
#created ⇒ Object
Override
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'app/helpers/glib/json_ui/action_builder.rb', line 19 def created if @analyticsEnabled suffix = @analyticsId # TODO: recognize_path() needs `method` as a second argument for POST request if suffix.nil? && @url && (route = Rails.application.routes.recognize_path(@url)) suffix = "#{route[:controller]}_#{route[:action]}" end if suffix json.analytics do json.track :event json.nameSuffix suffix end end end end |