Class: Socialmod::Item

Inherits:
Base
  • Object
show all
Defined in:
lib/socialmod/item.rb

Direct Known Subclasses

Audio, HTML, Image, Text, Video

Defined Under Namespace

Classes: Audio, HTML, Image, Text, Video

Constant Summary collapse

@@element_name =
'item'
@@collection_name =
'items'

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

api_key=, callback_url, callback_url=, #initialize

Constructor Details

This class inherits a constructor from Socialmod::Base

Class Method Details

.find_by_custom_id(id) ⇒ Object



15
16
17
# File 'lib/socialmod/item.rb', line 15

def find_by_custom_id(id)
  find(:one, :from => :custom, :params => {:id => id})
end

.syncObject Also known as: find_moderated

Find all moderated since last sync



10
11
12
# File 'lib/socialmod/item.rb', line 10

def sync
  find(:all, :from => :sync)
end

Instance Method Details

#deferred?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/socialmod/item.rb', line 32

def deferred?
  state == 'deferred'
end

#destroyObject



40
41
42
# File 'lib/socialmod/item.rb', line 40

def destroy
  raise "You can't destroy an item"
end

#failed?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/socialmod/item.rb', line 28

def failed?
  state == 'failed'
end

#flag!Object



20
21
22
# File 'lib/socialmod/item.rb', line 20

def flag!
  post(:flag)
end

#passed?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/socialmod/item.rb', line 24

def passed?
  state == 'passed'
end

#pending?Boolean

Returns:

  • (Boolean)


36
37
38
# File 'lib/socialmod/item.rb', line 36

def pending?
  state == 'pending'
end

#updateObject



44
45
46
# File 'lib/socialmod/item.rb', line 44

def update
  raise "You can't update an item"
end