Class: FreeRange::CLI::Pair
- Inherits:
-
Object
- Object
- FreeRange::CLI::Pair
- Defined in:
- lib/freerange.rb
Instance Method Summary collapse
- #email ⇒ Object
-
#initialize(pair) ⇒ Pair
constructor
A new instance of Pair.
- #initials ⇒ Object
- #name ⇒ Object
Constructor Details
#initialize(pair) ⇒ Pair
Returns a new instance of Pair.
20 21 22 23 24 25 |
# File 'lib/freerange.rb', line 20 def initialize(pair) @pair = pair owner_name = `git config --global --get user.name`.strip @owner = MEMBERS.keys.detect {|x| MEMBERS[x] == owner_name } raise "You can't pair with yourself." if @pair == @owner end |
Instance Method Details
#email ⇒ Object
31 32 33 |
# File 'lib/freerange.rb', line 31 def email "pairing+" + [@owner, @pair].sort.join('+') + "@gofreerange.com" end |
#initials ⇒ Object
35 36 37 |
# File 'lib/freerange.rb', line 35 def initials @pair.split(".").collect {|p| p[0..0]}.join end |