Module: Moonshot::MoonshotHelper
- Defined in:
- app/helpers/moonshot/moonshot_helper.rb
Instance Method Summary collapse
- #crisp_chat(user: nil, enabled: true, wrapper: :div, api_key:) ⇒ Object
- #post_hog_tracker(user: nil, enabled: true, api_key:) ⇒ Object
- #shepherd_tour(tour:, context: {}) ⇒ Object
Instance Method Details
#crisp_chat(user: nil, enabled: true, wrapper: :div, api_key:) ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'app/helpers/moonshot/moonshot_helper.rb', line 37 def crisp_chat user: nil, enabled: true, wrapper: :div, api_key: return unless enabled = { controller: 'crisp', crisp_website_id_value: api_key } if user .merge!({ crisp_identification_value: { name: user.tracker_name, email: user.tracker_email } }) end tag.send(wrapper, data: ) do yield if block_given? end end |
#post_hog_tracker(user: nil, enabled: true, api_key:) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'app/helpers/moonshot/moonshot_helper.rb', line 15 def post_hog_tracker user: nil, enabled: true, api_key: return unless enabled = { controller: 'post-hog', post_hog_api_key_value: api_key } if user = { id: user.id, name: user.tracker_name, email: user.tracker_email } .merge!({ post_hog_identification_value: }) end tag.div(data: ) end |
#shepherd_tour(tour:, context: {}) ⇒ Object
5 6 7 8 9 10 11 12 13 |
# File 'app/helpers/moonshot/moonshot_helper.rb', line 5 def shepherd_tour tour:, context: {} tag.div nil, data: { controller: 'shepherd', 'shepherd-tour-name-value' => tour, 'shepherd-endpoint-value' => shepherd_rails.tour_statuses_path, 'shepherd-config-value' => I18n.t(tour, scope: 'shepherd_rails'), 'shepherd-context-value' => context } end |