Class: ForestLiana::IntercomController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ForestLiana::IntercomController
- Defined in:
- app/controllers/forest_liana/intercom_controller.rb
Instance Method Summary collapse
- #attributes ⇒ Object
- #conversation ⇒ Object
- #conversations ⇒ Object
- #get_serializer_type(suffix) ⇒ Object
Instance Method Details
#attributes ⇒ Object
22 23 24 25 26 27 28 29 |
# File 'app/controllers/forest_liana/intercom_controller.rb', line 22 def attributes getter = IntercomAttributesGetter.new(params) getter.perform render serializer: nil, json: serialize_model(getter.record, { context: { type: get_serializer_type('intercom_attributes') } }) end |
#conversation ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'app/controllers/forest_liana/intercom_controller.rb', line 13 def conversation getter = IntercomConversationGetter.new(params) getter.perform render serializer: nil, json: serialize_model(getter.record, { context: { type: get_serializer_type('intercom_conversations') } }) end |
#conversations ⇒ Object
3 4 5 6 7 8 9 10 11 |
# File 'app/controllers/forest_liana/intercom_controller.rb', line 3 def conversations getter = IntercomConversationsGetter.new(params) getter.perform render serializer: nil, json: serialize_models(getter.records, { context: { type: get_serializer_type('intercom_conversations') }, meta: { count: getter.count } }) end |
#get_serializer_type(suffix) ⇒ Object
31 32 33 |
# File 'app/controllers/forest_liana/intercom_controller.rb', line 31 def get_serializer_type(suffix) "#{params[:collection]}_#{suffix}" end |