Class: Codeowners::Result
- Inherits:
-
Object
- Object
- Codeowners::Result
- Defined in:
- lib/codeowners/result.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#owners ⇒ Object
readonly
Returns the value of attribute owners.
Instance Method Summary collapse
-
#initialize(pattern = nil, owners = []) ⇒ Result
constructor
A new instance of Result.
- #successful? ⇒ Boolean
- #to_a ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(pattern = nil, owners = []) ⇒ Result
Returns a new instance of Result.
7 8 9 10 |
# File 'lib/codeowners/result.rb', line 7 def initialize(pattern = nil, owners = []) @pattern = pattern @owners = owners end |
Instance Attribute Details
#owners ⇒ Object (readonly)
Returns the value of attribute owners.
5 6 7 |
# File 'lib/codeowners/result.rb', line 5 def owners @owners end |
Instance Method Details
#successful? ⇒ Boolean
12 13 14 |
# File 'lib/codeowners/result.rb', line 12 def successful? !@pattern.nil? end |
#to_a ⇒ Object
20 21 22 |
# File 'lib/codeowners/result.rb', line 20 def to_a @owners.dup.flatten end |
#to_s ⇒ Object
16 17 18 |
# File 'lib/codeowners/result.rb', line 16 def to_s "#{@pattern}\n\n#{@owners.join('\n')}" end |