Class: Upfluence::Peer
- Inherits:
-
Object
- Object
- Upfluence::Peer
- Defined in:
- lib/upfluence/peer.rb
Instance Attribute Summary collapse
-
#app_name ⇒ Object
readonly
Returns the value of attribute app_name.
-
#authority ⇒ Object
readonly
Returns the value of attribute authority.
-
#environment ⇒ Object
readonly
Returns the value of attribute environment.
-
#instance_name ⇒ Object
readonly
Returns the value of attribute instance_name.
-
#project_name ⇒ Object
readonly
Returns the value of attribute project_name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ Peer
constructor
A new instance of Peer.
- #to_url ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ Peer
Returns a new instance of Peer.
6 7 8 9 10 11 12 |
# 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 |
Instance Attribute Details
#app_name ⇒ Object (readonly)
Returns the value of attribute app_name.
3 4 5 |
# File 'lib/upfluence/peer.rb', line 3 def app_name @app_name end |
#authority ⇒ Object (readonly)
Returns the value of attribute authority.
3 4 5 |
# File 'lib/upfluence/peer.rb', line 3 def @authority end |
#environment ⇒ Object (readonly)
Returns the value of attribute environment.
3 4 5 |
# File 'lib/upfluence/peer.rb', line 3 def environment @environment end |
#instance_name ⇒ Object (readonly)
Returns the value of attribute instance_name.
3 4 5 |
# File 'lib/upfluence/peer.rb', line 3 def instance_name @instance_name end |
#project_name ⇒ Object (readonly)
Returns the value of attribute project_name.
3 4 5 |
# File 'lib/upfluence/peer.rb', line 3 def project_name @project_name end |
Class Method Details
Instance Method Details
#to_url ⇒ Object
14 15 16 |
# File 'lib/upfluence/peer.rb', line 14 def to_url "peer://#{@environment}@#{@authority}/#{@instance_name}" end |