class Upfluence::Peer

Attributes

app_name[R]
authority[R]
environment[R]
instance_name[R]
project_name[R]

Public Class Methods

from_env() click to toggle source
# File lib/upfluence/peer.rb, line 19
def from_env
  Peer.new(
    authority:     ENV['AUTHORITY'],
    instance_name: ENV['INSTANCE_NAME'],
    app_name:      ENV['APP_NAME'],
    project_name:  ENV['PROJECT_NAME'],
    environment:   ENV['ENV']
  )
end
new(opts = {}) click to toggle source
# File lib/upfluence/peer.rb, line 6
def initialize(opts = {})
  @authority = opts[:authority] || 'local'
  @instance_name = opts[:instance_name] || 'unknown-server'
  @app_name = opts[:app_name] || 'unknown-name'
  @project_name = opts[:project_name] || 'unknown-app'
  @environment = opts[:environment] || 'development'
end

Public Instance Methods

to_url() click to toggle source
# File lib/upfluence/peer.rb, line 14
def to_url
  "peer://#{@environment}@#{@authority}/#{@instance_name}"
end