Class: Pairzone::Commands::Join
- Inherits:
-
Object
- Object
- Pairzone::Commands::Join
- Defined in:
- lib/pairzone/commands/join.rb
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(pairzone_name, identity) ⇒ Join
constructor
A new instance of Join.
Constructor Details
#initialize(pairzone_name, identity) ⇒ Join
Returns a new instance of Join.
6 7 8 9 |
# File 'lib/pairzone/commands/join.rb', line 6 def initialize(pairzone_name, identity) @pairzone_name = pairzone_name @identity = File.(identity) end |
Instance Method Details
#execute ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/pairzone/commands/join.rb', line 11 def execute pairzone = Pairzone::Api::Pairzone.find_by_project_name(@pairzone_name) if (pairzone.nil?) Logger.error("No pairzone exists with the name '#{@pairzone_name}'.") else pairzone.connect(@identity) end end |