Class: Ghub::Models::Branch
- Inherits:
-
Struct
- Object
- Struct
- Ghub::Models::Branch
- Defined in:
- lib/ghub/models/branch.rb
Overview
Defines a branch.
Instance Attribute Summary collapse
-
#label ⇒ Object
Returns the value of attribute label.
-
#ref ⇒ Object
Returns the value of attribute ref.
-
#repo ⇒ Object
Returns the value of attribute repo.
-
#sha ⇒ Object
Returns the value of attribute sha.
-
#user ⇒ Object
Returns the value of attribute user.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Branch
constructor
A new instance of Branch.
Constructor Details
#initialize ⇒ Branch
Returns a new instance of Branch.
16 17 18 19 |
# File 'lib/ghub/models/branch.rb', line 16 def initialize(**) super freeze end |
Instance Attribute Details
#label ⇒ Object
Returns the value of attribute label
6 7 8 |
# File 'lib/ghub/models/branch.rb', line 6 def label @label end |
#ref ⇒ Object
Returns the value of attribute ref
6 7 8 |
# File 'lib/ghub/models/branch.rb', line 6 def ref @ref end |
#repo ⇒ Object
Returns the value of attribute repo
6 7 8 |
# File 'lib/ghub/models/branch.rb', line 6 def repo @repo end |
#sha ⇒ Object
Returns the value of attribute sha
6 7 8 |
# File 'lib/ghub/models/branch.rb', line 6 def sha @sha end |
#user ⇒ Object
Returns the value of attribute user
6 7 8 |
# File 'lib/ghub/models/branch.rb', line 6 def user @user end |
Class Method Details
.for(**attributes) ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/ghub/models/branch.rb', line 7 def self.for(**attributes) new( **attributes.merge!( user: User[**attributes[:user]], repo: Repository.for(**attributes[:repo]) ) ) end |