Class: Service
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Service
- Defined in:
- app/models/service.rb
Overview
An external service that JOGL can use on behalf of a User within the context of a Serviceable object.
Instance Attribute Summary collapse
-
#creator ⇒ User
User who created the Service.
-
#name ⇒ String
popular name of the Service.
-
#token ⇒ String
provides access to the Service.
Instance Method Summary collapse
- #as_json(_options = {}) ⇒ Object
-
#flows ⇒ Array<Symbol>
Return all the flow names for this Service in the ServiceFlowRegistry.
Instance Attribute Details
#creator ⇒ User
User who created the Service
8 9 10 |
# File 'app/models/service.rb', line 8 def creator @creator end |
#name ⇒ String
popular name of the Service
8 9 10 |
# File 'app/models/service.rb', line 8 def name @name end |
#token ⇒ String
provides access to the Service
8 9 10 |
# File 'app/models/service.rb', line 8 def token @token end |
Instance Method Details
#as_json(_options = {}) ⇒ Object
26 27 28 |
# File 'app/models/service.rb', line 26 def as_json( = {}) super(except: [:token], methods: [:flows]) end |
#flows ⇒ Array<Symbol>
Return all the flow names for this Service in the ServiceFlowRegistry.
22 23 24 |
# File 'app/models/service.rb', line 22 def flows ServiceFlowRegistry.service_flows[name.to_sym].keys end |