Class: GetFilmInfoFullHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/filmweb_api/method_handlers/get_film_info_full_handler.rb

Constant Summary collapse

REQUEST_ATTRIBUTES =
[
  :movie_id
].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**attributes) ⇒ GetFilmInfoFullHandler

Returns a new instance of GetFilmInfoFullHandler.



35
36
37
38
# File 'lib/filmweb_api/method_handlers/get_film_info_full_handler.rb', line 35

def initialize(**attributes)
  @attributes = attributes
  @movie_id = attributes[:movie_id]
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



33
34
35
# File 'lib/filmweb_api/method_handlers/get_film_info_full_handler.rb', line 33

def attributes
  @attributes
end

#movie_idObject (readonly)

Returns the value of attribute movie_id.



33
34
35
# File 'lib/filmweb_api/method_handlers/get_film_info_full_handler.rb', line 33

def movie_id
  @movie_id
end

Instance Method Details

#callObject

Raises:

  • (ArgumentError)


40
41
42
43
# File 'lib/filmweb_api/method_handlers/get_film_info_full_handler.rb', line 40

def call
  raise ArgumentError.new("You need to pass all required attributes for that method") unless all_required_attributes?
  Hash[RESPONSE_KEYS.zip(filmweb_response)]
end