Module: Movieman::Themoviedb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#f ⇒ Object
Returns the value of attribute f.
Class Method Summary collapse
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
8 9 10 |
# File 'lib/movieman/themoviedb.rb', line 8 def api_key @api_key end |
#f ⇒ Object
Returns the value of attribute f.
8 9 10 |
# File 'lib/movieman/themoviedb.rb', line 8 def f @f end |
Class Method Details
.config(&block) ⇒ Object
10 |
# File 'lib/movieman/themoviedb.rb', line 10 def self.config(&block) instance_eval(&block); end |
.movie(id) ⇒ Object
20 21 22 |
# File 'lib/movieman/themoviedb.rb', line 20 def self.movie id f.get "/3/movie/#{id}?api_key=#{api_key}" end |
.search(q, page = 0) ⇒ Object
24 25 26 27 28 29 30 31 |
# File 'lib/movieman/themoviedb.rb', line 24 def self.search q, page=0 f.get do |r| r.url "/3/search/movie" r.params['query'] = q r.params['api_key'] = api_key r.params['page'] = page unless page == 0 end end |