Class: Jani::ConverterClient::Response

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/jani/converter_client/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(http_response) ⇒ Response

Returns a new instance of Response.



9
10
11
12
13
14
15
16
17
# File 'lib/jani/converter_client/response.rb', line 9

def initialize(http_response)
  @http_response = http_response

  @movie = if success?
    Jani::FromJson.to_movie(http_response.body)
  else
    Jani::FromJson.empty_movie
  end
end

Instance Attribute Details

#movieObject (readonly)

Returns the value of attribute movie.



6
7
8
# File 'lib/jani/converter_client/response.rb', line 6

def movie
  @movie
end