Class: GitPunch::Repository
- Inherits:
-
Object
- Object
- GitPunch::Repository
- Defined in:
- lib/git_punch/repository.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
Returns the value of attribute path.
-
#user ⇒ Object
Returns the value of attribute user.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Repository
constructor
A new instance of Repository.
- #name ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Repository
Returns a new instance of Repository.
7 8 9 10 11 12 13 14 |
# File 'lib/git_punch/repository.rb', line 7 def initialize ={} @path = [:from] @user = if [:user].nil? User.from_config else create_user_from [:user] end end |
Instance Attribute Details
#path ⇒ Object
Returns the value of attribute path.
5 6 7 |
# File 'lib/git_punch/repository.rb', line 5 def path @path end |
#user ⇒ Object
Returns the value of attribute user.
5 6 7 |
# File 'lib/git_punch/repository.rb', line 5 def user @user end |
Class Method Details
.current! ⇒ Object
20 21 22 |
# File 'lib/git_punch/repository.rb', line 20 def self.current! new from: ENV['PWD'] end |
Instance Method Details
#name ⇒ Object
16 17 18 |
# File 'lib/git_punch/repository.rb', line 16 def name File.basename path end |