Class: Mite::SingletonBase

Inherits:
Base
  • Object
show all
Includes:
ResourceWithoutWriteAccess
Defined in:
lib/mite-rb.rb

Direct Known Subclasses

Account, Myself

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ResourceWithoutWriteAccess

#create, #destroy, #save

Methods inherited from Base

all, first, inherited, last

Class Method Details

.collection_nameObject



153
154
155
# File 'lib/mite-rb.rb', line 153

def collection_name
  element_name
end

.collection_path(prefix_options = {}, query_options = nil) ⇒ Object



162
163
164
165
# File 'lib/mite-rb.rb', line 162

def collection_path(prefix_options = {}, query_options = nil)
  prefix_options, query_options = split_options(prefix_options) if query_options.nil?
  "#{prefix(prefix_options)}#{collection_name}.#{format.extension}#{query_string(query_options)}"
end

.element_path(id, prefix_options = {}, query_options = nil) ⇒ Object



157
158
159
160
# File 'lib/mite-rb.rb', line 157

def element_path(id, prefix_options = {}, query_options = nil)
  prefix_options, query_options = split_options(prefix_options) if query_options.nil?
  "#{prefix(prefix_options)}#{collection_name}.#{format.extension}#{query_string(query_options)}"
end

Instance Method Details

#allObject

Prevent collection methods

Raises:



176
177
178
# File 'lib/mite-rb.rb', line 176

def all
  raise MethodNotAvaible, "Method not supported on #{self.class.name}"
end

#findObject Also known as: first, last



168
169
170
# File 'lib/mite-rb.rb', line 168

def find
  super(1)
end