Class: Git::Copilot::Configuration::User

Inherits:
Struct
  • Object
show all
Defined in:
lib/git/copilot/configuration.rb,
lib/git/copilot/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#emailObject

Returns the value of attribute email

Returns:

  • (Object)

    the current value of email



4
5
6
# File 'lib/git/copilot/configuration.rb', line 4

def email
  @email
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



4
5
6
# File 'lib/git/copilot/configuration.rb', line 4

def name
  @name
end

#usernameObject

Returns the value of attribute username

Returns:

  • (Object)

    the current value of username



4
5
6
# File 'lib/git/copilot/configuration.rb', line 4

def username
  @username
end

Instance Method Details

#to_committerObject



6
7
8
# File 'lib/git/copilot/configuration.rb', line 6

def to_committer
  format "%{name} <%{email}>", name: name, email: email
end

#to_hObject



10
11
12
13
14
15
# File 'lib/git/copilot/configuration.rb', line 10

def to_h
  {
    "name" => name,
    "email" => email,
  }
end