Class: SiteDiff::UriWrapper::ReadResult
- Inherits:
-
Object
- Object
- SiteDiff::UriWrapper::ReadResult
- Defined in:
- lib/sitediff/uriwrapper.rb
Overview
This lets us treat errors or content as one object
Instance Attribute Summary collapse
-
#content ⇒ Object
Returns the value of attribute content.
-
#error ⇒ Object
Returns the value of attribute error.
-
#error_code ⇒ Object
Returns the value of attribute error_code.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(content = nil) ⇒ ReadResult
constructor
A new instance of ReadResult.
Constructor Details
#initialize(content = nil) ⇒ ReadResult
Returns a new instance of ReadResult.
23 24 25 26 27 |
# File 'lib/sitediff/uriwrapper.rb', line 23 def initialize(content = nil) @content = content @error = nil @error_code = nil end |
Instance Attribute Details
#content ⇒ Object
Returns the value of attribute content.
21 22 23 |
# File 'lib/sitediff/uriwrapper.rb', line 21 def content @content end |
#error ⇒ Object
Returns the value of attribute error.
21 22 23 |
# File 'lib/sitediff/uriwrapper.rb', line 21 def error @error end |
#error_code ⇒ Object
Returns the value of attribute error_code.
21 22 23 |
# File 'lib/sitediff/uriwrapper.rb', line 21 def error_code @error_code end |
Class Method Details
.error(err, code = nil) ⇒ Object
29 30 31 32 33 34 |
# File 'lib/sitediff/uriwrapper.rb', line 29 def self.error(err, code = nil) res = new res.error_code = code res.error = err res end |