Class: Springnote::Page

Inherits:
Base
  • Object
show all
Includes:
ImportFile
Defined in:
lib/springnote/page.rb

Constant Summary

Constants included from ImportFile

ImportFile::BOUNDARY

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ImportFile

#import_file, included

Methods inherited from Base

#id, #id=, #to_param

Methods included from ActiveResourceExtension

#find

Class Method Details

.search(query, params = {}) ⇒ Object



8
9
10
# File 'lib/springnote/page.rb', line 8

def self.search(query, params = {})
  find(:all, :params => params.reverse_merge(:q => query))
end

.with_tags(tags, params = {}) ⇒ Object



4
5
6
# File 'lib/springnote/page.rb', line 4

def self.with_tags(tags, params = {})
  find(:all, :params => params.reverse_merge(:tags => tags))
end

Instance Method Details

#attachmentsObject



16
17
18
# File 'lib/springnote/page.rb', line 16

def attachments
  @attachments ||= Springnote::Attachment.find(:all, :params => {:relation_is_part_of => self.id})
end

#commentsObject



20
21
22
# File 'lib/springnote/page.rb', line 20

def comments
  @comments ||= Springnote::Comment.find(:all, :params => {:relation_is_part_of => self.id})
end

#lockObject



12
13
14
# File 'lib/springnote/page.rb', line 12

def lock
  @lock ||= Springnote::Lock.find(:relation_is_part_of => self.id)
end