Class: Springnote::Page

Inherits:
Resource show all
Defined in:
lib/springnote_client.rb

Constant Summary

Constants inherited from Resource

Resource::XML

Instance Attribute Summary

Attributes inherited from Resource

#hash, #holder

Attributes inherited from RestClient::Resource

#url

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Resource

build, collection_url, #delete, element_url, #element_url, find, find_all, find_multi, find_one, find_some, #identifier=, #inspect, #method_missing, new_resource, #save, search, #singular_name, #to_s

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Springnote::Resource

Class Method Details

.collection_nameObject



41
# File 'lib/springnote_client.rb', line 41

def self.collection_name; 'pages' end

.singular_nameObject



40
# File 'lib/springnote_client.rb', line 40

def self.singular_name;   'page'  end

Instance Method Details

#attachmentsObject



43
44
45
# File 'lib/springnote_client.rb', line 43

def attachments
  CallProxy.new(Attachment, self)
end

#make_url(path = '/', params = {}) ⇒ Object



47
48
49
50
51
52
53
# File 'lib/springnote_client.rb', line 47

def make_url(path = '/', params = {})
  if self.hash
    holder.make_url("/pages/#{self.hash['identifier']}#{path}", params)
  else
    holder.make_url(path, params)        
  end
end