Class: Arkaan::Monitoring::Route

Inherits:
Object
  • Object
show all
Includes:
Concerns::Activable, Concerns::Premiumable, Mongoid::Document, Mongoid::Timestamps
Defined in:
lib/arkaan/monitoring/route.rb

Overview

A route is an endpoint accessible in a service. Each route has to have an associated endpoint in the deployed instances.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#authenticatedBoolean

Returns if true, the session_id is needed for this route, if false it is not.

Returns:

  • (Boolean)

    if true, the session_id is needed for this route, if false it is not.



22
# File 'lib/arkaan/monitoring/route.rb', line 22

field :authenticated, type: Boolean, default: true

#groupsArray<Arkaan::Permissions::Group>

Returns the groups having permission to access this route.

Returns:



30
# File 'lib/arkaan/monitoring/route.rb', line 30

has_and_belongs_to_many :groups, class_name: 'Arkaan::Permissions::Group', inverse_of: :groups

#pathString

Returns the path (URI) of the route in the service?.

Returns:

  • (String)

    the path (URI) of the route in the service?



16
# File 'lib/arkaan/monitoring/route.rb', line 16

field :path, type: String, default: '/'

#serviceArkaan::Monitoring::Service

Returns the service in which this route is declared.

Returns:



26
# File 'lib/arkaan/monitoring/route.rb', line 26

belongs_to :service, class_name: 'Arkaan::Monitoring::Service', inverse_of: :routes

#verbString

Returns the verb (HTTP method) of this route in the service.

Returns:

  • (String)

    the verb (HTTP method) of this route in the service.



19
# File 'lib/arkaan/monitoring/route.rb', line 19

field :verb, type: String, default: 'get'

Instance Method Details

#complete_pathString

Returns the complete path, enriched with the path of the service.

Returns:

  • (String)

    the complete path to access this route from the outside.



40
41
42
# File 'lib/arkaan/monitoring/route.rb', line 40

def complete_path
  path == '/' ? service.path : "#{service.path}#{path}"
end