Class: ComicVine::Resource::Movie

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

Overview

Extends Movie 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



442
443
444
445
446
447
448
# File 'lib/comicvine/mongo.rb', line 442

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



452
453
454
# File 'lib/comicvine/mongo.rb', line 452

def has_staff_review?
  !self.has_staff_review.empty?
end