Module: Movieman::Themoviedb

Extended by:
Themoviedb
Included in:
Themoviedb
Defined in:
lib/movieman/themoviedb.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#api_keyObject

Returns the value of attribute api_key.



8
9
10
# File 'lib/movieman/themoviedb.rb', line 8

def api_key
  @api_key
end

#fObject

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