Class: ComicVine::Resource::Episode

Inherits:
ComicVine::Resource show all
Includes:
Mongo, Mongoid::Document
Defined in:
lib/comicvine/mongo.rb

Overview

Extends Episode to add mongoid functions

Since:

  • 0.1.2

Constant Summary

Constants included from Mongo

Mongo::VERSION

Instance Method Summary collapse

Methods included from Mongo

#_fetch_by_assoc_and_id, #initialize, #save_assoc!

Methods inherited from ComicVine::Resource

create_resource

Instance Method Details

#has_staff_review=(value) ⇒ Object

Accounts for ComicVine’s miss-match return of false if no review exists. Sets an empty hash

Parameters:

  • value (Hash)

Since:

  • 0.1.0



349
350
351
352
353
354
355
# File 'lib/comicvine/mongo.rb', line 349

def has_staff_review=(value)
  if value.nil? || value.kind_of?(FalseClass)
    self.has_staff_review = {}
  else
    super
  end
end

#has_staff_review?true, false

Returns:

  • (true, false)

Since:

  • 0.1.2



359
360
361
# File 'lib/comicvine/mongo.rb', line 359

def has_staff_review?
  !self.has_staff_review.empty?
end