Class: Lookout::Result
Direct Known Subclasses
Lookout::Results::Error, Lookout::Results::Failure, Lookout::Results::Fulfilled
Instance Attribute Summary collapse
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(file, line) ⇒ Result
constructor
A new instance of Result.
- #to_s ⇒ Object
Constructor Details
#initialize(file, line) ⇒ Result
Returns a new instance of Result.
14 15 16 |
# File 'lib/lookout/result.rb', line 14 def initialize(file, line) @file, @line = file, line end |
Instance Attribute Details
#file ⇒ Object (readonly)
Returns the value of attribute file.
18 19 20 |
# File 'lib/lookout/result.rb', line 18 def file @file end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
18 19 20 |
# File 'lib/lookout/result.rb', line 18 def line @line end |
Class Method Details
.is(is) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/lookout/result.rb', line 5 def is(is) [:error, :failure, :fulfilled].each do |type| define_method :"#{type}?" do type == is end end end |
Instance Method Details
#to_s ⇒ Object
20 21 22 |
# File 'lib/lookout/result.rb', line 20 def to_s '%s:%d' % [file, line] end |