Class: ComicVine::Resource::Movie

Inherits:
ComicVine::Resource show all
Includes:
Mongo, Mongoid::Attributes::Dynamic, 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, #fetch_and_update!, #fetch_and_update_assoc!, #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



507
508
509
510
511
512
513
# File 'lib/comicvine/mongo.rb', line 507

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



517
518
519
# File 'lib/comicvine/mongo.rb', line 517

def has_staff_review?
  !self.has_staff_review.empty?
end