Class: Result
- Inherits:
-
Object
- Object
- Result
- Defined in:
- lib/teuton-get/searcher/result.rb
Constant Summary collapse
- @@repoindex =
Set.new
Instance Attribute Summary collapse
-
#reponame ⇒ Object
readonly
Returns the value of attribute reponame.
-
#score ⇒ Object
Returns the value of attribute score.
-
#testname ⇒ Object
readonly
Returns the value of attribute testname.
Instance Method Summary collapse
- #id ⇒ Object
-
#initialize(args) ⇒ Result
constructor
A new instance of Result.
- #repoindex ⇒ Object
- #to_h ⇒ Object
Constructor Details
#initialize(args) ⇒ Result
Returns a new instance of Result.
10 11 12 13 14 15 |
# File 'lib/teuton-get/searcher/result.rb', line 10 def initialize(args) @score = args[:score] || 0 @reponame = args[:reponame] || "???" @testname = args[:testname] || "???" @@repoindex << @reponame end |
Instance Attribute Details
#reponame ⇒ Object (readonly)
Returns the value of attribute reponame.
7 8 9 |
# File 'lib/teuton-get/searcher/result.rb', line 7 def reponame @reponame end |
#score ⇒ Object
Returns the value of attribute score.
6 7 8 |
# File 'lib/teuton-get/searcher/result.rb', line 6 def score @score end |
#testname ⇒ Object (readonly)
Returns the value of attribute testname.
8 9 10 |
# File 'lib/teuton-get/searcher/result.rb', line 8 def testname @testname end |
Instance Method Details
#id ⇒ Object
17 18 19 |
# File 'lib/teuton-get/searcher/result.rb', line 17 def id "#{reponame}#{Settings::SEPARATOR}#{testname}" end |
#repoindex ⇒ Object
31 32 33 |
# File 'lib/teuton-get/searcher/result.rb', line 31 def repoindex @@repoindex.to_a.index(@reponame) end |
#to_h ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/teuton-get/searcher/result.rb', line 21 def to_h { score: @score, id: id, reponame: @reponame, testname: @testname, repoindex: repoindex } end |