Class: Stardog::StardogResponse
- Inherits:
-
Object
- Object
- Stardog::StardogResponse
- Defined in:
- lib/stardog.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(status, body) ⇒ StardogResponse
constructor
A new instance of StardogResponse.
- #success? ⇒ Boolean
- #to_s ⇒ Object
Constructor Details
#initialize(status, body) ⇒ StardogResponse
Returns a new instance of StardogResponse.
41 42 43 44 |
# File 'lib/stardog.rb', line 41 def initialize(status, body) @status = status @body = body end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
39 40 41 |
# File 'lib/stardog.rb', line 39 def body @body end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
39 40 41 |
# File 'lib/stardog.rb', line 39 def status @status end |
Instance Method Details
#success? ⇒ Boolean
46 47 48 |
# File 'lib/stardog.rb', line 46 def success? @status.to_s =~ /^2\d{2}$/ end |
#to_s ⇒ Object
50 51 52 |
# File 'lib/stardog.rb', line 50 def to_s "#{status}\n--------\n#{body}\n--------\n" end |