Class: Network::Commit
- Inherits:
-
Object
- Object
- Network::Commit
- Includes:
- ActionView::Helpers::TagHelper
- Defined in:
- app/models/network/commit.rb
Instance Attribute Summary collapse
-
#parent_spaces ⇒ Object
Returns the value of attribute parent_spaces.
-
#spaces ⇒ Object
Returns the value of attribute spaces.
-
#time ⇒ Object
Returns the value of attribute time.
Instance Method Summary collapse
-
#initialize(raw_commit) ⇒ Commit
constructor
A new instance of Commit.
- #method_missing(msg, *args, &block) ⇒ Object
- #parents(map) ⇒ Object
- #space ⇒ Object
Constructor Details
#initialize(raw_commit) ⇒ Commit
Returns a new instance of Commit.
9 10 11 12 13 14 |
# File 'app/models/network/commit.rb', line 9 def initialize(raw_commit) @commit = raw_commit @time = -1 @spaces = [] @parent_spaces = [] end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(msg, *args, &block) ⇒ Object
16 17 18 |
# File 'app/models/network/commit.rb', line 16 def method_missing(msg, *args, &block) @commit.__send__(msg, *args, &block) # rubocop:disable GitlabSecurity/PublicSend end |
Instance Attribute Details
#parent_spaces ⇒ Object
Returns the value of attribute parent_spaces.
7 8 9 |
# File 'app/models/network/commit.rb', line 7 def parent_spaces @parent_spaces end |
#spaces ⇒ Object
Returns the value of attribute spaces.
7 8 9 |
# File 'app/models/network/commit.rb', line 7 def spaces @spaces end |
#time ⇒ Object
Returns the value of attribute time.
7 8 9 |
# File 'app/models/network/commit.rb', line 7 def time @time end |
Instance Method Details
#parents(map) ⇒ Object
28 29 30 |
# File 'app/models/network/commit.rb', line 28 def parents(map) map.values_at(*@commit.parent_ids).compact end |
#space ⇒ Object
20 21 22 23 24 25 26 |
# File 'app/models/network/commit.rb', line 20 def space if @spaces.present? @spaces.first else 0 end end |