Class: Typekit::Connection::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/typekit/connection/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#bodyObject (readonly)

Returns the value of attribute body.



4
5
6
# File 'lib/typekit/connection/response.rb', line 4

def body
  @body
end

#codeObject (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

Returns:

  • (Boolean)


11
12
13
# File 'lib/typekit/connection/response.rb', line 11

def success?
  [ 200, 302 ].include?(@code)
end