Class: Typekit::Connection::Response
- Inherits:
-
Object
- Object
- Typekit::Connection::Response
- Defined in:
- lib/typekit/connection/response.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#code ⇒ Object
readonly
Returns the value of attribute code.
Instance Method Summary collapse
-
#initialize(code:, body:) ⇒ Response
constructor
A new instance of Response.
- #success? ⇒ Boolean
Constructor Details
#initialize(code:, body:) ⇒ Response
Returns a new instance of Response.
6 7 8 9 |
# File 'lib/typekit/connection/response.rb', line 6 def initialize(code:, body:) @code = code @body = body end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
4 5 6 |
# File 'lib/typekit/connection/response.rb', line 4 def body @body end |
#code ⇒ Object (readonly)
Returns the value of attribute code.
4 5 6 |
# File 'lib/typekit/connection/response.rb', line 4 def code @code end |
Instance Method Details
#success? ⇒ Boolean
11 12 13 |
# File 'lib/typekit/connection/response.rb', line 11 def success? [ 200, 302 ].include?(@code) end |