Class: Coauthor::Git::Template

Inherits:
Object
  • Object
show all
Includes:
Constants
Defined in:
lib/coauthor/git/template.rb

Constant Summary

Constants included from Constants

Constants::PAIR_CONFIG_FILE, Constants::PAIR_FILE_PATH

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(credentials:) ⇒ Template

Returns a new instance of Template.



9
10
11
12
# File 'lib/coauthor/git/template.rb', line 9

def initialize(credentials:)
  @credentials = credentials
  write_file
end

Instance Attribute Details

#credentialsObject (readonly)

Returns the value of attribute credentials.



8
9
10
# File 'lib/coauthor/git/template.rb', line 8

def credentials
  @credentials
end

Class Method Details

.callObject



14
15
16
17
18
19
20
# File 'lib/coauthor/git/template.rb', line 14

def self.call
  credentials = Prompt.(user_count: 2)
  return unless credentials
  new(credentials: credentials)
rescue SystemExit, Interrupt
  puts "\n...Template setup cancelled".colorize(:red)
end