Class: Mediaman::Trakt::Fetcher

Inherits:
Hash
  • Object
show all
Includes:
HTTParty
Defined in:
lib/mediaman/trakt.rb

Direct Known Subclasses

Movie, TVEpisode, TVShow

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Fetcher

Returns a new instance of Fetcher.



26
27
28
29
# File 'lib/mediaman/trakt.rb', line 26

def initialize(options = {})
  self.options = options
  self.merge!(fetch! || {}) if self.respond_to?(:fetch!)
end

Instance Attribute Details

#optionsObject

Returns the value of attribute options.



30
31
32
# File 'lib/mediaman/trakt.rb', line 30

def options
  @options
end

#responseObject

Returns the value of attribute response.



31
32
33
# File 'lib/mediaman/trakt.rb', line 31

def response
  @response
end

Class Method Details

.from_hash(hash = {}) ⇒ Object



20
21
22
23
24
# File 'lib/mediaman/trakt.rb', line 20

def self.from_hash(hash = {})
  f = self.new()
  f.merge!(hash) if hash.present?
  f
end