Class: ComicVine::Resource::Issue

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

Overview

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



179
180
181
182
183
184
185
# File 'lib/comicvine/mongo.rb', line 179

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



189
190
191
# File 'lib/comicvine/mongo.rb', line 189

def has_staff_review?
  !self.has_staff_review.empty?
end