Class: Service

Inherits:
ApplicationRecord show all
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

Instance Method Summary collapse

Instance Attribute Details

#creatorUser

User who created the Service

Returns:

  • (User)

    the current value of creator



8
9
10
# File 'app/models/service.rb', line 8

def creator
  @creator
end

#nameString

popular name of the Service

Returns:

  • (String)

    the current value of name



8
9
10
# File 'app/models/service.rb', line 8

def name
  @name
end

#tokenString

provides access to the Service

Returns:

  • (String)

    the current value of token



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(_options = {})
  super(except: [:token], methods: [:flows])
end

#flowsArray<Symbol>

Return all the flow names for this Service in the ServiceFlowRegistry.

Returns:

  • (Array<Symbol>)

    the .



22
23
24
# File 'app/models/service.rb', line 22

def flows
  ServiceFlowRegistry.service_flows[name.to_sym].keys
end