Class: Bucketface::Repository
- Inherits:
-
Object
- Object
- Bucketface::Repository
- Defined in:
- lib/bucketface/repository.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
-
#initialize(repo) ⇒ Repository
constructor
A new instance of Repository.
- #to_s ⇒ Object
- #user ⇒ Object
Constructor Details
#initialize(repo) ⇒ Repository
Returns a new instance of Repository.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/bucketface/repository.rb', line 5 def initialize(repo) case repo when String repo = repo.split("/") @name = repo.pop @username = repo.pop when Repository @username = repo.username @name = repo.name when Hash @name = repo[:repo] ||= repo[:name] @username = repo[:username] ||= repo[:user] end end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/bucketface/repository.rb', line 3 def name @name end |
#username ⇒ Object
Returns the value of attribute username.
3 4 5 |
# File 'lib/bucketface/repository.rb', line 3 def username @username end |
Instance Method Details
#to_s ⇒ Object
24 25 26 |
# File 'lib/bucketface/repository.rb', line 24 def to_s @name end |
#user ⇒ Object
20 21 22 |
# File 'lib/bucketface/repository.rb', line 20 def user @username end |