Class: NetFlix::Title

Inherits:
Valuable show all
Defined in:
lib/net_flix/title.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Valuable

#attributes, attributes, create_accessor_for, create_setter_for, #deep_duplicate_of, defaults, has_collection, has_value, #initialize

Constructor Details

This class inherits a constructor from Valuable

Class Method Details

.complete_listObject



27
28
29
30
# File 'lib/net_flix/title.rb', line 27

def complete_list
  data = NetFlix::API::Catalog::Titles.index
  TitleBuilder.from_xml(data)
end

.from_json(data) ⇒ Object



17
18
19
# File 'lib/net_flix/title.rb', line 17

def self.from_json(data)
  self.new(JSON.parse(data))
end

.search(params) ⇒ Object



32
33
34
35
# File 'lib/net_flix/title.rb', line 32

def search(params)
  data = NetFlix::API::Catalog::Titles.search(params)
  TitleBuilder.from_xml(data)
end

Instance Method Details

#to_jsonObject



13
14
15
# File 'lib/net_flix/title.rb', line 13

def to_json
  attributes.to_json
end

#to_sObject



21
22
23
# File 'lib/net_flix/title.rb', line 21

def to_s
  title || 'unknown title'
end